osgiknopflerfish

Any way to make a bundle required with Knoplerfish?


Is there any way to abort the startup of Knoplerfish if a specific bundle fails to initialize? By default, a FrameworkErrorEvent is printed to the console and the framework continues to load.

init.xargs

-initlevel 80
-istart my-required-bundle.jar

console output

[stdout] Installed and started: file:jars/my-required-bundle.jar (id#34)
[stdout] ## DEBUG: errors - FrameworkErrorEvent bundle #34
[stdout] ## DEBUG: errors - FrameworkErrorEvent throwable:
[stderr] org.osgi.framework.BundleException: BundleActivator start failed

Solution

  • There is no standard OSGi way to do this, since there is no standard way to tell the framework what bundles to install (that is up to a launcher). There is also no standard way to get notified of this event, so you can act on it. If Knopflerfish does not provide a specific system property or something similar to handle this, I see two routes you could take.