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.

On Mon, Jun 25, 2012 at 6:21 AM, Raman Gupta <rocketra...@gmail.com> wrote:
> I just upgraded to Karaf 2.2.7 from Karaf 2.2.4 and noticed that now
> the Spring DM web extender and pax web extender's no longer run in the
> correct order.
>
> The Spring-DM extender needs to process the bundle *before* the PaxWeb
> extender, since until the app context is created by Spring-DM it is a
> non-functional web bundle. If Pax Web attempts to process it first,
> there is an error about the Spring context not existing when the
> servlet tries to initialize.
>
> A manual refresh of the bundle is required to fix the problem.
>
> One difference I can see between 2.2.4 and 2.2.7 is that the start
> level of the pax bundles is different. In Karaf 2.2.4, the pax bundles
> started at the default start level which was 60, but in 2.2.7 the war
> feature specifies they start at the same level as the Spring-DM
> bundles, which is 30. I don't know if that is the underlying problem
> though.
>
> Is there a way to control the order of the extender execution? If not,
> what is the best work-around?
>
> Regards,
> Raman



-- 
------------------------
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
FuseSource, Integration everywhere
http://fusesource.com

Reply via email to