Start-level can't really be trusted, especially if you use blueprint for example, which does actually start the blueprint stuff asynchronously.
On Thu, Jan 19, 2012 at 15:49, Donald Whytock <dwhyt...@gmail.com> wrote: > It may be a matter of personal taste, but I disagree with reliance on > start levels. It should be more reliable to use a BundleListener to > track whether a particular bundle has loaded, or a ServiceTracker with > the bundle being watched for launching a "here I am" service when > initialization is complete. > > Don > > On Thu, Jan 19, 2012 at 9:39 AM, metatech <metatec...@gmail.com> wrote: >> Hi, >> >> My previous conclusion was not correct. >> The Camel initialization happens indeed in the "addingBundle" method, but is >> called from a SynchronousBundleListener, in the same thread that activates >> the bundle, and there is only one thread ("FelixStartlevel") that activates >> all feature bundles, so it should it should fully initialized. >> >> However, when the problem happens, the following error is logged : >> 2012-01-19 09:35:41,655 | INFO | ExtenderThread-5 | | >> CamelNamespaceHandler | OSGi environment not detected. >> >> This can happen if the OSGi activator of the bundle "camel-spring" was not >> executed before the Camel context is starting. In SMX 4.4, camel-spring is >> at start-level 50, and applications are at start-level 60, so the activator >> is meant to be completed before applications are starting. >> >> However, during the first start-up, or when the bundle cache is cleaned up, >> the bundles delivered as Karaf "features" are installed in parallel with the >> deployment of applications in the "deploy" directory. This can explain that >> the camel-spring (not yet installed at level 50) is executed after some >> applications are starting. >> >> The only solution I can think of is that the bundle cache should be built in >> a first phase, then the bundle are started in a second phase. >> >> Regards, >> >> metatech >> >> >> >> >> metatech wrote >>> >>> However, the Camel initialization is not finished yet, it is performed in >>> the "addingBundle" method, which registers Camel components, languages, >>> type converters, ... >>> >> >> >> -- >> View this message in context: >> http://camel.465427.n5.nabble.com/Camel-under-OSGi-without-Spring-et-al-tp4507473p5157820.html >> Sent from the Camel - Users mailing list archive at Nabble.com. -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com