You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by JacobS <ja...@gmail.com> on 2012/09/19 20:47:32 UTC
camelcontext cant find class in osgi environment
I am using camel (tried 2.6 and 2.10.1) in an osgi environment and I am
getting exceptions when camel is checking an 'is' predicate:
org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: is
operator cannot find class with name: MyClassName
It seems that the class loader used by camel is the camel-core bundle class
loader which doesn't know the required class. is it possible to set the
camelcontext class loader ?
--
View this message in context: http://camel.465427.n5.nabble.com/camelcontext-cant-find-class-in-osgi-environment-tp5719618.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camelcontext cant find class in osgi environment
Posted by JacobS <ja...@gmail.com>.
how ?
currently I am creating the bean like this:
<camelContext id="mainCamelContext"
xmlns="http://camel.apache.org/schema/spring"
trace="false" >
...
--
View this message in context: http://camel.465427.n5.nabble.com/camelcontext-cant-find-class-in-osgi-environment-tp5719618p5719661.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camelcontext cant find class in osgi environment
Posted by Claus Ibsen <cl...@gmail.com>.
On Thu, Sep 20, 2012 at 10:38 AM, JacobS <ja...@gmail.com> wrote:
> I am using virgo web server, and after more digging it looks as though the
> problem is that I am not importing 'org.springframework.osgi.core'.
> But if I do import 'org.springframework.osgi.core', I am having other issues
> in my environment.
>
There is a camel-core-osgi which has a OsgiDefaultCamelContext you need to use.
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camelcontext-cant-find-class-in-osgi-environment-tp5719618p5719652.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: camelcontext cant find class in osgi environment
Posted by JacobS <ja...@gmail.com>.
I am using virgo web server, and after more digging it looks as though the
problem is that I am not importing 'org.springframework.osgi.core'.
But if I do import 'org.springframework.osgi.core', I am having other issues
in my environment.
--
View this message in context: http://camel.465427.n5.nabble.com/camelcontext-cant-find-class-in-osgi-environment-tp5719618p5719652.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: camelcontext cant find class in osgi environment
Posted by Claus Ibsen <cl...@gmail.com>.
What osgi environment are you using? And how do you bootstrap Camel in that?
If you use Karaf or SMX with Camel defined in spring-dm or blueprint XML files
then that would work out of the box.
On Wed, Sep 19, 2012 at 8:47 PM, JacobS <ja...@gmail.com> wrote:
> I am using camel (tried 2.6 and 2.10.1) in an osgi environment and I am
> getting exceptions when camel is checking an 'is' predicate:
>
> org.apache.camel.language.simple.types.SimpleIllegalSyntaxException: is
> operator cannot find class with name: MyClassName
>
> It seems that the class loader used by camel is the camel-core bundle class
> loader which doesn't know the required class. is it possible to set the
> camelcontext class loader ?
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/camelcontext-cant-find-class-in-osgi-environment-tp5719618.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen