camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to reference RouteBuilder in the context - Camel 2.0-snapshot
Date Wed, 01 Apr 2009 05:16:07 GMT
On Wed, Apr 1, 2009 at 6:53 AM, Ryan Gardner <ryebrye@gmail.com> wrote:
> I just switched to 2.0-snapshot and I don't know how to get my routeBuilders
> in the context properly.
>
>    <bean id="someRouteBuilder" class="com.foo.SomeRouteBuilder">
>    </bean>
>
> using a <camel:routeBuilder ref="someRouteBuilder" /> inside my camelcontext
> I get this exception on startup:
>
> Caused by: org.springframework.beans.factory.BeanCreationException: Error
> creating bean with name 'camel:beanPostProcessor': Cannot resolve reference
> to bean 'camel' while setting bean property 'camelContext'; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'camel': Invocation of init method failed; nested exception
> is org.springframework.beans.factory.BeanCreationException: Error creating
> bean with name 'org.apache.camel.builder.RouteBuilder': Instantiation of
> bean failed; nested exception is
> org.springframework.beans.BeanInstantiationException: Could not instantiate
> bean class [org.apache.camel.builder.RouteBuilder]: Is it an abstract
> class?; nested exception is java.lang.InstantiationException
>
> Is there some other way to do this?

Yes they are not automatically picked up now, you need to add a
<routeBuilder ref="someRouterBuilder"/> in the <camelContext> tag.
This was a bit to magical, and if you have two camel context they
would both load the same route builder etc.



>
> Ryan
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Apache Camel Reference Card:
http://refcardz.dzone.com/refcardz/enterprise-integration

Mime
View raw message