You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Punnoose, Roshan" <pu...@bah-systems.com> on 2007/08/14 19:38:06 UTC

Camel/Spring issue

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

 


Re: Camel/Spring issue

Posted by James Strachan <ja...@gmail.com>.
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 <ja...@gmail.com> wrote:
> On 8/14/07, Punnoose, Roshan <pu...@bah-systems.com> 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/

Re: Camel/Spring issue

Posted by James Strachan <ja...@gmail.com>.
On 8/14/07, Punnoose, Roshan <pu...@bah-systems.com> 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/