camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Spring destroys camelTemplate before CamelContext
Date Fri, 10 Feb 2012 07:05:52 GMT
On Thu, Feb 9, 2012 at 12:35 AM, muhammad siddique
<> wrote:
> I tried removing camelTemplate from spring configuration and creating camel
> Producer template from camel context in my POJO. Here is what i got
> 2012-02-08 17:26:01,144 DEBUG
> [org.apache.camel.processor.DefaultErrorHandler.debug(72)] - <Failed
> delivery for exchangeId: ID-msidd-3710-1328739667175-0-17. On delivery
> attempt: 0 caught: org.apache.camel.RuntimeCamelException:
> org.springframework.beans.factory.BeanCreationNotAllowedException: Error
> creating bean with name 'camel': Singleton bean creation not allowed while
> the singletons of this factory are in destruction (Do not request a bean
> from a BeanFactory in a destroy method implementation!)>
> It looks like spring has no way to find that camel Context is the bean that
> should be destroyed first.
> I looked into code of SpringCamelContext and it doesn't implement
> SmartLifecycle interface from spring. If it does , we will probably have a
> way to tell spring its creation and destruction order.

If the SmartLifecycle is part of Spring 3.0 api, then that would be
possible to improve in camel-spring, as we are spring 3.0+ api
We love contributions at Apache Camel. So take a dive into and see if
you can help with this.

> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus, fusenews
Author of Camel in Action:

View raw message