Camel/Spring issue

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel/Spring issue

RoshanP
When integrating Camel into my Spring app, I get this exception:

 

Caused by: java.lang.ClassCastException:
org.springframework.context.support.GenericApplicationContext

            at
org.apache.camel.spring.SpringCamelContext.createInjector(SpringCamelCon
text.java:147)

            at
org.apache.camel.impl.DefaultCamelContext.getInjector(DefaultCamelContex
t.java:322)

            at
org.apache.camel.impl.DefaultCamelContext.forceLazyInitialization(Defaul
tCamelContext.java:407)

            at
org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.ja
va:373)

            at
org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.ja
va:139)

            at
org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:38)

            at
org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(Camel
ContextFactoryBean.java:103)

            ... 20 more

 

 

This is what my configuration is:

 

<bean id="camel"
class="org.apache.camel.spring.CamelContextFactoryBean">

      </bean>

 

I use the SingletonBeanFactoryLocator to load my Spring configurations.
Any ideas?

 

Roshan Punnoose

Phone: 301-497-6039

 

Reply | Threaded
Open this post in threaded view
|

Re: Camel/Spring issue

jstrachan
On 8/14/07, Punnoose, Roshan <[hidden email]> wrote:
> When integrating Camel into my Spring app, I get this exception:
> Caused by: java.lang.ClassCastException:
> org.springframework.context.support.GenericApplicationContext
>
>             at

Sorry about that!

This looks like a bug in the SpringCamelContext; assuming that the
ApplicationContext is-an AbstractRefreshableApplicationContext, so it
can't handle GenericApplicationContext.

I've raised a JIRA for this...
https://issues.apache.org/activemq/browse/CAMEL-103


I should have a fix in trunk very soon! A workaround is to use another
ApplicationContext implementation (ClassPathXmlApplicationContext /
FileXmlApplicationContext etc).


> org.apache.camel.spring.SpringCamelContext.createInjector(SpringCamelCon
> text.java:147)

--
James
-------
http://macstrac.blogspot.com/
Reply | Threaded
Open this post in threaded view
|

Re: Camel/Spring issue

jstrachan
BTW I've just committed a patch to trunk which I think should fix your
issue - I'll create an explicit test case to resolve CAMEL-103
tomorrow...

On 8/14/07, James Strachan <[hidden email]> wrote:

> On 8/14/07, Punnoose, Roshan <[hidden email]> wrote:
> > When integrating Camel into my Spring app, I get this exception:
> > Caused by: java.lang.ClassCastException:
> > org.springframework.context.support.GenericApplicationContext
> >
> >             at
>
> Sorry about that!
>
> This looks like a bug in the SpringCamelContext; assuming that the
> ApplicationContext is-an AbstractRefreshableApplicationContext, so it
> can't handle GenericApplicationContext.
>
> I've raised a JIRA for this...
> https://issues.apache.org/activemq/browse/CAMEL-103
>
>
> I should have a fix in trunk very soon! A workaround is to use another
> ApplicationContext implementation (ClassPathXmlApplicationContext /
> FileXmlApplicationContext etc).
>
>
> > org.apache.camel.spring.SpringCamelContext.createInjector(SpringCamelCon
> > text.java:147)
>
> --
> James
> -------
> http://macstrac.blogspot.com/
>


--
James
-------
http://macstrac.blogspot.com/