When launching Karaf 2.2.9 with an empty bundle cache, the framework's active start level is already set to org.osgi.framework.startlevel.beginning before all the boot features have been started. The impact is that bundles can be loaded in the wrong order, and File Install ends up scanning the deploy folder when it's not supposed to.
This is problematic because we're using boot features to load up our core infrastructure and the deploy folder to host plugins. If we prepackage any plugins with our product with an empty bundle cache, the plugins get installed and started before the core.
The attached tarball contains a set of 3 bundles that reproduce the symptoms. Simply untar within the apache-karaf-2.2.9 directory.
In the test tarball, there are 3 bundles that do the same thing. When start() is called, they print out their name and the framework's current start level, then wait for 1 second.
bundle1 (start-level=60) and bundle2 (start-level=80) are part of a boot feature. However, bundle2 is listed first in the XML. bundle3 is in the deploy directory. File Install is configured so that it doesn't scan until start level 81 (via felix.fileinstall.active.level).
I'm expecting that the bundles are loaded in this order: bundle1, bundle2, bundle3.
If I clear the bundle cache and start Karaf, I get the following output:
This indicates that when bundle2's start() is called, the framework's start level is already set to org.osgi.framework.startlevel.beginning (in this case, 100) before the boot features have started.
If I run Karaf again without clearing the bundle cache, I get the following:
This is better, but felix.fileinstall.active.level is set to 81, so bundle3 should not be starting at start level 80. This is probably a separate issue.