camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Pilone <>
Subject RE: SpringCamelContext afterPropertiesSet never called
Date Wed, 11 Jan 2012 18:40:31 GMT

I put a sample application that shows the problem up at

It is a maven project so you can compile it with "mvn compile" and run it with "mvn exec:java".
You can also open it up in Eclipse.

Let me know if you need any more information. Note that I'm also using Java 7 but I don't
see how that could be involved.


 | Mike Pilone | Software Architect, Distribution | | o: 202-513-2679  m:

-----Original Message-----
From: Hadrian Zbarcea [] 
Sent: Wednesday, January 11, 2012 12:50 PM
Subject: Re: SpringCamelContext afterPropertiesSet never called

Mike, do you have a piece of (xml) code that reproduces this?

On 01/11/2012 11:23 AM, Mike Pilone wrote:
> I'm debugging an issue where my Spring initialized code attempts to use
> a Camel route before the route is initialized. I attempted to fix this
> by adding "depends-on" in my Spring configuration to make my code depend
> on the camelContext but it didn't help. I could see that the context was
> being created, then my code created (which starts executing in another
> thread), then the context was started.
> I debugged the SpringCamelContext and found that the
> afterPropertiesMethod is never called which means the context isn't
> started until onApplicationEvent is fired with a ContextRefreshedEvent.
> A breakpoint in afterPropertiesMethod is never triggered so maybeStart()
> is never called. So the "depends-on" doesn't help because Spring
> considers the SprintCamelContext initialized and allows bean creation to
> continue even though the context is not yet started.
> I'm using Spring 3.1.0 and Camel 2.9.0. Is this a known issue? Any
> suggestions for a work-around?
> -mike
> _* | Mike Pilone | Software Architect, Distribution |
> <> | o: 202-513-2679 m: 703-969-7493

Hadrian Zbarcea
Principal Software Architect
Talend, Inc

View raw message