You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vseibt <vo...@buenting.de> on 2013/04/08 11:12:25 UTC

Camel and osgi - component not found

I have a Problem using camel with osgi (eclipse virgo server).

I've defined a camel-route with camel-java-dsl like "from("quartz:...") in
my OSGi-Module.

On trying to start the route I get the error "Failed to create route [...]
No component found with scheme: quartz".

All camel and spring modules are in place.

I'm not realy surprised about this error, because in general camel finds its
components doing a classpath-search in
META-INF/service/org/apache/camel/component.
Because this "Packages" is not exported from camel-quartz this component
can't be found from the classloader for my module.

After adding this path including the file quartz from camel-quartz to my
module everything runs pretty well (that's why I'm sure all modules are in
place).

But this can't be the intended way using camel and osgi.

This seems not only to be a problem for camel-quartz but for all camel
components.

How is it done "the right way"?
Or is it a bug in camel osgi-bundling?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-and-osgi-component-not-found-tp5730484.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel and osgi - component not found

Posted by vseibt <vo...@buenting.de>.
Thanks for your reply,

maybe it's a problem of the eclipse virgo server.

I found several discussions about the META-INF/services FactoryFinder
pattern:
http://blog.osgi.org/,
http://www.osgi.org/download/osgi-early-draft-2011-09.pdf
and it's not in
http://www.osgi.org/Download/File?url=/download/r5/osgi.core-5.0.0.pdf but
only in 
http://www.osgi.org/Download/File?url=/download/r5/osgi.enterprise-5.0.0.pdf.

Maybe it's not (yet) implemented by the virgo-server. Camel seems to be
manly used with Karaf as osgi container.

Another workaround seems to be declaring a spring bean of the component type
with the component's name as you would do with component "jms" which is
usually parameterized with configuration.

My route is declard as follows:


The MANIFEST.MF of the bundle looks like:




--
View this message in context: http://camel.465427.n5.nabble.com/Camel-and-osgi-component-not-found-tp5730484p5730492.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel and osgi - component not found

Posted by Willem jiang <wi...@gmail.com>.
Hi,

Camel supports OSGi out of box.
How did you deploy you camel route?
camel-core will try to locate the component from the OSGi bundle, if you deploy the camel-core bundle and camel-quartz bundle, the camel-qurtz component can be found without doing any additional work.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Monday, April 8, 2013 at 5:12 PM, vseibt wrote:

> I have a Problem using camel with osgi (eclipse virgo server).
>  
> I've defined a camel-route with camel-java-dsl like "from("quartz:...") in
> my OSGi-Module.
>  
> On trying to start the route I get the error "Failed to create route [...]
> No component found with scheme: quartz".
>  
> All camel and spring modules are in place.
>  
> I'm not realy surprised about this error, because in general camel finds its
> components doing a classpath-search in
> META-INF/service/org/apache/camel/component.
> Because this "Packages" is not exported from camel-quartz this component
> can't be found from the classloader for my module.
>  
> After adding this path including the file quartz from camel-quartz to my
> module everything runs pretty well (that's why I'm sure all modules are in
> place).
>  
> But this can't be the intended way using camel and osgi.
>  
> This seems not only to be a problem for camel-quartz but for all camel
> components.
>  
> How is it done "the right way"?
> Or is it a bug in camel osgi-bundling?
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-and-osgi-component-not-found-tp5730484.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).