If you use a spring web app, do you really need to use spring-dm in addition ? Why don't you just use the spring app ?
On Tue, Jun 26, 2012 at 1:23 AM, Raman Gupta <rocketra...@gmail.com> wrote: > On 06/25/2012 03:21 AM, Guillaume Nodet wrote: >> That's a quite big problem and I'm not really aware of any way to >> control the extender execution order. >> The reason is that each extender can work synchronously or >> asynchronously and there's no coordination between them, there's not >> even a way to specify such a thing. >> I can only see two ways out: >> * enhance the extenders to better cooperate, but this would require >> enhancing all the extenders and defining some metadata to control such >> an order (given anyone can write an extender, this would be better if >> we had a spec for that) >> * do the synchronization on your own, i.e. you can detect using a >> spring bean when the spring app will be processed and from a servlet >> when the web app stuff will be kicked, then make sure one is waiting >> for the other. >> >> The last option is the easiest one to achieve obviously, but will be >> really tied to the extenders your using and how they behave, as if >> both are started synchronously, you won't really have any way to do >> some synchronization here, but iirc that's not the case here. > > I'm trying to do the second option (manual synchronization) as > described here. > > It isn't working as Pax Web itself attempts to initialize the Spring > context due to the Spring ContextLoaderListener that is defined in > web.xml, which then breaks the manual synchronization. > > Here is the stack for the Pax Web initialization of the context: > > http://pastebin.com/raw.php?i=RTunRTkF > > From the stack, the general path to the bean being initialized is: > > swissbox BundleWatcher -> WebXmlObserver -> WebAppPublisher -> Pax Web > Jetty -> ContextLoaderListener -> ExtenderOrderingBean.init() > > Then when the servlet is loaded by Pax Web, ExtenderOrderingBean > thinks the context is good since it was "created" by Pax Web, and the > stack which started this whole mess is again produced: > > http://pastebin.com/raw.php?i=PJvMqWRV > > I actually don't see where the Spring-DM extender loads the bean at all... > > So still looking for solutions... IMO, the behavior of Karaf 2.2.4 was > perfect in this situation, and required no such hackish work-arounds. > > Regards, > Raman -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com