You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by nono <ya...@db-is.com> on 2015/05/21 11:21:03 UTC

is it dependency issue?

when i try to start bundle, i got below error.
is it dependency issue?

Caused by: org.apache.camel.RuntimeCamelException: Cannot auto create
component: file
        at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:322)
        at
org.apache.camel.impl.DefaultCamelContext.getEndpoint(DefaultCamelContext.java:441)
        ... 27 more
Caused by: java.lang.ClassCastException:
org.apache.camel.impl.osgi.Activator$BundleComponentResolver cannot be cast
to org.apache.camel.spi.ComponentResolver
        at
org.apache.camel.core.osgi.OsgiComponentResolver.getComponent(OsgiComponentResolver.java:72)
        at
org.apache.camel.core.osgi.OsgiComponentResolver.resolveComponent(OsgiComponentResolver.java:64)
        at
org.apache.camel.impl.DefaultCamelContext.getComponent(DefaultCamelContext.java:311)
        ... 28 more



--
View this message in context: http://camel.465427.n5.nabble.com/is-it-dependency-issue-tp5767374.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: is it dependency issue?

Posted by Shemeem <sh...@bdbizviz.com>.
Hi,

What is your OSGI container? 
Is it Karaf? If so, you have to install camel in karaf (even though, you
have provided dependency in camel ) with the below command :

karaf@root> features:chooseurl camel 2.12.1 (provide the version you want)
karaf@root> features:install camel

These camel commands may have little difference based on your karaf version.
 
This is how you should initialize your camel context for OSGI bundles in
case of Java DSL.

OsgiServiceRegistry reg = new OsgiServiceRegistry(bundleContext); 

context=new OsgiDefaultCamelContext(bundleContext, reg); 




--
View this message in context: http://camel.465427.n5.nabble.com/is-it-dependency-issue-tp5767374p5767390.html
Sent from the Camel - Users mailing list archive at Nabble.com.