You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@karaf.apache.org by Thiago Souza <tc...@gmail.com> on 2010/08/16 06:21:22 UTC

Karaf, Camel and startup race conditons

Hello there,

       I've setup a production server based on karaf and camel. I've
installed camel through the features mechanism and deployed several spring
xml files that defines components and camel contexts instantiation. 

       Everything is fine until the server is restarted. In this case I get
all sort of random problem like type converters that can not be found,
routes based on quartz throwing exceptions and other weird behavior. The
only way to solve this problem is to undeploy all the xml files, restart the
system and redeploy them in a controlled way.

       How can I solve this? Is there any way to start the xmls AFTER all
the camel bundles and have them started in an ordered way?

Regards,
Thiago Souza
-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Camel-and-startup-race-conditons-tp1165020p1165020.html
Sent from the Karaf - User mailing list archive at Nabble.com.

Re: Karaf, Camel and startup race conditons

Posted by Charles Moulliard <cm...@gmail.com>.
Hi Thiago,

You can define the bundle start level of the bundles that you deploy through
features provisioning mechanism following the documentation here :
http://karaf.apache.org/46-provisioning.html

The camel bundles does not have a bundle start level different from 50 but
this should be the case in the future. Nevertheless, you can already change
the camel feature file and add the attribute start-level.

Kind regards,

Charles Moulliard

Senior Enterprise Architect (J2EE, .NET, SOA)
Apache Camel - Karaf - ServiceMix Committer
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blog : http://cmoulliard.blogspot.com |  Twitter :
http://twitter.com/cmoulliard
Linkedin : http://www.linkedin.com/in/charlesmoulliard | Skype: cmoulliard


On Mon, Aug 16, 2010 at 7:03 AM, Guillaume Nodet <gn...@gmail.com> wrote:

> The issue comes from Spring-DM which has a big flaw in the sense it
> can not provide any way to handle those dependencies.  We had the same
> problem and the best way to solve those is to use Aries Blueprint and
> Camel Blueprint support instead of spring.
> You could try playing with the bundle start level, but I won't solve
> all the problems as spring does some things asynchronously wrt the
> bundles starting, so you'll still have race conditions.  It might help
> a bit though, so feel free to give it a try.   I think the easiest way
> would be to configure fileinstall so that the bundles deployed have a
> bundle start level greater than the default bundle start level.  I
> can't lookup the exact mechanism right now, but will try this evening
> if no one gave it to you (I think Charles has experimented things like
> that IIRC).
>
> On Mon, Aug 16, 2010 at 06:21, Thiago Souza <tc...@gmail.com> wrote:
> >
> > Hello there,
> >
> >       I've setup a production server based on karaf and camel. I've
> > installed camel through the features mechanism and deployed several
> spring
> > xml files that defines components and camel contexts instantiation.
> >
> >       Everything is fine until the server is restarted. In this case I
> get
> > all sort of random problem like type converters that can not be found,
> > routes based on quartz throwing exceptions and other weird behavior. The
> > only way to solve this problem is to undeploy all the xml files, restart
> the
> > system and redeploy them in a controlled way.
> >
> >       How can I solve this? Is there any way to start the xmls AFTER all
> > the camel bundles and have them started in an ordered way?
> >
> > Regards,
> > Thiago Souza
> > --
> > View this message in context:
> http://karaf.922171.n3.nabble.com/Karaf-Camel-and-startup-race-conditons-tp1165020p1165020.html
> > Sent from the Karaf - User mailing list archive at Nabble.com.
> >
>
>
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>

Re: Karaf, Camel and startup race conditons

Posted by Guillaume Nodet <gn...@gmail.com>.
The issue comes from Spring-DM which has a big flaw in the sense it
can not provide any way to handle those dependencies.  We had the same
problem and the best way to solve those is to use Aries Blueprint and
Camel Blueprint support instead of spring.
You could try playing with the bundle start level, but I won't solve
all the problems as spring does some things asynchronously wrt the
bundles starting, so you'll still have race conditions.  It might help
a bit though, so feel free to give it a try.   I think the easiest way
would be to configure fileinstall so that the bundles deployed have a
bundle start level greater than the default bundle start level.  I
can't lookup the exact mechanism right now, but will try this evening
if no one gave it to you (I think Charles has experimented things like
that IIRC).

On Mon, Aug 16, 2010 at 06:21, Thiago Souza <tc...@gmail.com> wrote:
>
> Hello there,
>
>       I've setup a production server based on karaf and camel. I've
> installed camel through the features mechanism and deployed several spring
> xml files that defines components and camel contexts instantiation.
>
>       Everything is fine until the server is restarted. In this case I get
> all sort of random problem like type converters that can not be found,
> routes based on quartz throwing exceptions and other weird behavior. The
> only way to solve this problem is to undeploy all the xml files, restart the
> system and redeploy them in a controlled way.
>
>       How can I solve this? Is there any way to start the xmls AFTER all
> the camel bundles and have them started in an ordered way?
>
> Regards,
> Thiago Souza
> --
> View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Camel-and-startup-race-conditons-tp1165020p1165020.html
> Sent from the Karaf - User mailing list archive at Nabble.com.
>



-- 
Cheers,
Guillaume Nodet
------------------------
Blog: http://gnodet.blogspot.com/
------------------------
Open Source SOA
http://fusesource.com

Re: Karaf, Camel and startup race conditons

Posted by Achim Nierbeck <ac...@ptv.de>.
Hi, 

there is a way of configuring Spring-DM to go synchronous, 

add the following line to your manifest: 

Spring-Context: *;create-asynchrously:=false


But as far as I can tell from the documentation it has some side effects,
make shure those don't bother you either :)

you might also take a look at the Spring-DM documentation: 
http://static.springsource.org/osgi/docs/1.2.1/reference/html-single/

cheers, Achim 




Thiago Souza wrote:
> 
> Hello there,
> 
>        I've setup a production server based on karaf and camel. I've
> installed camel through the features mechanism and deployed several spring
> xml files that defines components and camel contexts instantiation. 
> 
>        Everything is fine until the server is restarted. In this case I
> get all sort of random problem like type converters that can not be found,
> routes based on quartz throwing exceptions and other weird behavior. The
> only way to solve this problem is to undeploy all the xml files, restart
> the system and redeploy them in a controlled way.
> 
>        How can I solve this? Is there any way to start the xmls AFTER all
> the camel bundles and have them started in an ordered way?
> 
> Regards,
> Thiago Souza
> 

-- 
View this message in context: http://karaf.922171.n3.nabble.com/Karaf-Camel-and-startup-race-conditons-tp1165020p1183652.html
Sent from the Karaf - User mailing list archive at Nabble.com.