You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2013/09/02 17:45:01 UTC

[jira] [Commented] (CAMEL-6699) camel-blueprint - Using routeContextRef to refer to a RouteBuilder in another bundle causes ClassCastException

    [ https://issues.apache.org/jira/browse/CAMEL-6699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13756137#comment-13756137 ] 

Claus Ibsen commented on CAMEL-6699:
------------------------------------

Remember to expose the RouteBuilder class using its interface which is org.apache.camel.RoutesBuilder. eg notice the S in Route***s***Builder.
                
> camel-blueprint - Using routeContextRef to refer to a RouteBuilder in another bundle causes ClassCastException
> --------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-6699
>                 URL: https://issues.apache.org/jira/browse/CAMEL-6699
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint
>    Affects Versions: 2.11.0
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.10.7, 2.11.2, 2.12.0
>
>
> See
> http://camel.465427.n5.nabble.com/Referencing-OSGi-services-with-RouteBuilder-classes-for-use-in-CamelContext-tp5734660.html
> I can reproduce with stacktrace
> {code}
> Caused by: java.lang.ClassCastException: Proxyfdf03102_b8fa_4caf_b44c_fa565998bb6e cannot be cast to org.apache.camel.builder.RouteBuilder
> 	at org.apache.camel.model.RouteBuilderDefinition.createRouteBuilder(RouteBuilderDefinition.java:64)
> 	at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.installRoutes(AbstractCamelContextFactoryBean.java:727)
> 	at org.apache.camel.core.xml.AbstractCamelContextFactoryBean.setupRoutes(AbstractCamelContextFactoryBean.java:299)
> 	at org.apache.camel.blueprint.CamelContextFactoryBean.afterPropertiesSet(CamelContextFactoryBean.java:300)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.7.0_25]
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)[:1.7.0_25]
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.7.0_25]
> 	at java.lang.reflect.Method.invoke(Method.java:606)[:1.7.0_25]
> 	at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:297)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:958)[7:org.apache.aries.blueprint.core:1.1.0]
> 	at org.apache.aries.blueprint.container.BeanRecipe.runBeanProcInit(BeanRecipe.java:712)[7:org.apache.aries.blueprint.core:1.1.0]
> 	... 40 more
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira