You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stephan Burkard <sb...@gmail.com> on 2013/12/13 09:44:20 UTC
JSR-233 and Camel-Script in OSGi environment (servicemix)
Hi Camel users
Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our platform
version is currently 2.8 and that version suffers from a bug with
errorhandling.
However, when the route of that bundle gets the first message, camel-script
tries to create a script engine for javascript (although I only use
simple-statements?!?). That fails with the error message "No script engine
could be created for: js".
I tried to provide the package "com.sun.script.javascript" in the
system-bundle via custom.properties file of servicemix. That works fine and
the import-package-statement of my bundle seems to be fulfilled on bundle
startup. But the error message on consumption remains, I guess because of
different classloaders.
How can I provide a javascript script-engine to the embedded Camel 2.9
version. Is there an osgi-bundle I can also embed that provides the engine?
Thanks
Stephan
Re: JSR-233 and Camel-Script in OSGi environment (servicemix)
Posted by Stephan Burkard <sb...@gmail.com>.
OK, I found out that the JavaScript was loaded because of a custom
ValueBuilder that is buried in our own code. I can avoid loading JavaScript
now, have dropped the camel-script-component and therefore the ugly
"embedded-camel-hack" works.
When we update the plattform (fuse-distribution) to a version with at least
Camel 2.9.0 I will happily remove the whole Camel-embedding! :-)
Thanks
Stephan
On Sun, Dec 15, 2013 at 12:22 PM, Richard Kettelerij <
richardkettelerij@gmail.com> wrote:
> I think the issue is resolved if you just drop the camel-script dependency
> (feature in Karaf terms).
>
>
> On Sat, Dec 14, 2013 at 4:05 PM, Stephan Burkard <sb...@gmail.com>
> wrote:
>
> > Hi Richard
> >
> > Yes I am referring to the Simple language. I was surprised that it tries
> to
> > load JavaScript, and if I had explicitly used a JavaScript expression, I
> > would have been changed it. But it seems that it is loaded because of a
> > Predicate in an onWhen clause of an onException block.
> >
> > That gave me the impression that I cannot fully control when a script
> > language is loaded and therefore I tried to solve the problem (until now
> > without success). So if there is a way to avoid loading script languages
> at
> > all (and use Simple instead), this would be a nice workaround.
> >
> > Thanks
> > Stephan
> >
> >
> >
> > On Sat, Dec 14, 2013 at 11:58 AM, Richard Kettelerij <
> > richardkettelerij@gmail.com> wrote:
> >
> > > You say you only use "simple statements", are you referring to the
> simple
> > > language (http://camel.apache.org/simple)? If so, you don't need to
> > > include
> > > camel-script at all. The simple language is part of camel-core and
> > doesn't
> > > require any external dependencies, apart from OGNL which is optional.
> > >
> > >
> > > On Fri, Dec 13, 2013 at 10:06 AM, Claus Ibsen <cl...@gmail.com>
> > > wrote:
> > >
> > > > Hi
> > > >
> > > > I suggest to find another way with SMX 4.5.x and wait for SMX 4.6
> > > > which uses latest releases of all sorts. Usually OSGi is tricky and
> we
> > > > fix once in a while some gremlins to get stuff working in OSGi. And
> > > > Camel 2.9 is just too old.
> > > >
> > > >
> > > >
> > > > On Fri, Dec 13, 2013 at 9:44 AM, Stephan Burkard <sburkard@gmail.com
> >
> > > > wrote:
> > > > > Hi Camel users
> > > > >
> > > > > Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our
> > > > platform
> > > > > version is currently 2.8 and that version suffers from a bug with
> > > > > errorhandling.
> > > > >
> > > > > However, when the route of that bundle gets the first message,
> > > > camel-script
> > > > > tries to create a script engine for javascript (although I only use
> > > > > simple-statements?!?). That fails with the error message "No script
> > > > engine
> > > > > could be created for: js".
> > > > >
> > > > > I tried to provide the package "com.sun.script.javascript" in the
> > > > > system-bundle via custom.properties file of servicemix. That works
> > fine
> > > > and
> > > > > the import-package-statement of my bundle seems to be fulfilled on
> > > bundle
> > > > > startup. But the error message on consumption remains, I guess
> > because
> > > of
> > > > > different classloaders.
> > > > >
> > > > > How can I provide a javascript script-engine to the embedded Camel
> > 2.9
> > > > > version. Is there an osgi-bundle I can also embed that provides the
> > > > engine?
> > > > >
> > > > > Thanks
> > > > > Stephan
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > Email: cibsen@redhat.com
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > Make your Camel applications look hawt, try: http://hawt.io
> > > >
> > >
> >
>
Re: JSR-233 and Camel-Script in OSGi environment (servicemix)
Posted by Richard Kettelerij <ri...@gmail.com>.
I think the issue is resolved if you just drop the camel-script dependency
(feature in Karaf terms).
On Sat, Dec 14, 2013 at 4:05 PM, Stephan Burkard <sb...@gmail.com> wrote:
> Hi Richard
>
> Yes I am referring to the Simple language. I was surprised that it tries to
> load JavaScript, and if I had explicitly used a JavaScript expression, I
> would have been changed it. But it seems that it is loaded because of a
> Predicate in an onWhen clause of an onException block.
>
> That gave me the impression that I cannot fully control when a script
> language is loaded and therefore I tried to solve the problem (until now
> without success). So if there is a way to avoid loading script languages at
> all (and use Simple instead), this would be a nice workaround.
>
> Thanks
> Stephan
>
>
>
> On Sat, Dec 14, 2013 at 11:58 AM, Richard Kettelerij <
> richardkettelerij@gmail.com> wrote:
>
> > You say you only use "simple statements", are you referring to the simple
> > language (http://camel.apache.org/simple)? If so, you don't need to
> > include
> > camel-script at all. The simple language is part of camel-core and
> doesn't
> > require any external dependencies, apart from OGNL which is optional.
> >
> >
> > On Fri, Dec 13, 2013 at 10:06 AM, Claus Ibsen <cl...@gmail.com>
> > wrote:
> >
> > > Hi
> > >
> > > I suggest to find another way with SMX 4.5.x and wait for SMX 4.6
> > > which uses latest releases of all sorts. Usually OSGi is tricky and we
> > > fix once in a while some gremlins to get stuff working in OSGi. And
> > > Camel 2.9 is just too old.
> > >
> > >
> > >
> > > On Fri, Dec 13, 2013 at 9:44 AM, Stephan Burkard <sb...@gmail.com>
> > > wrote:
> > > > Hi Camel users
> > > >
> > > > Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our
> > > platform
> > > > version is currently 2.8 and that version suffers from a bug with
> > > > errorhandling.
> > > >
> > > > However, when the route of that bundle gets the first message,
> > > camel-script
> > > > tries to create a script engine for javascript (although I only use
> > > > simple-statements?!?). That fails with the error message "No script
> > > engine
> > > > could be created for: js".
> > > >
> > > > I tried to provide the package "com.sun.script.javascript" in the
> > > > system-bundle via custom.properties file of servicemix. That works
> fine
> > > and
> > > > the import-package-statement of my bundle seems to be fulfilled on
> > bundle
> > > > startup. But the error message on consumption remains, I guess
> because
> > of
> > > > different classloaders.
> > > >
> > > > How can I provide a javascript script-engine to the embedded Camel
> 2.9
> > > > version. Is there an osgi-bundle I can also embed that provides the
> > > engine?
> > > >
> > > > Thanks
> > > > Stephan
> > >
> > >
> > >
> > > --
> > > Claus Ibsen
> > > -----------------
> > > Red Hat, Inc.
> > > Email: cibsen@redhat.com
> > > Twitter: davsclaus
> > > Blog: http://davsclaus.com
> > > Author of Camel in Action: http://www.manning.com/ibsen
> > > Make your Camel applications look hawt, try: http://hawt.io
> > >
> >
>
Re: JSR-233 and Camel-Script in OSGi environment (servicemix)
Posted by Stephan Burkard <sb...@gmail.com>.
Hi Richard
Yes I am referring to the Simple language. I was surprised that it tries to
load JavaScript, and if I had explicitly used a JavaScript expression, I
would have been changed it. But it seems that it is loaded because of a
Predicate in an onWhen clause of an onException block.
That gave me the impression that I cannot fully control when a script
language is loaded and therefore I tried to solve the problem (until now
without success). So if there is a way to avoid loading script languages at
all (and use Simple instead), this would be a nice workaround.
Thanks
Stephan
On Sat, Dec 14, 2013 at 11:58 AM, Richard Kettelerij <
richardkettelerij@gmail.com> wrote:
> You say you only use "simple statements", are you referring to the simple
> language (http://camel.apache.org/simple)? If so, you don't need to
> include
> camel-script at all. The simple language is part of camel-core and doesn't
> require any external dependencies, apart from OGNL which is optional.
>
>
> On Fri, Dec 13, 2013 at 10:06 AM, Claus Ibsen <cl...@gmail.com>
> wrote:
>
> > Hi
> >
> > I suggest to find another way with SMX 4.5.x and wait for SMX 4.6
> > which uses latest releases of all sorts. Usually OSGi is tricky and we
> > fix once in a while some gremlins to get stuff working in OSGi. And
> > Camel 2.9 is just too old.
> >
> >
> >
> > On Fri, Dec 13, 2013 at 9:44 AM, Stephan Burkard <sb...@gmail.com>
> > wrote:
> > > Hi Camel users
> > >
> > > Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our
> > platform
> > > version is currently 2.8 and that version suffers from a bug with
> > > errorhandling.
> > >
> > > However, when the route of that bundle gets the first message,
> > camel-script
> > > tries to create a script engine for javascript (although I only use
> > > simple-statements?!?). That fails with the error message "No script
> > engine
> > > could be created for: js".
> > >
> > > I tried to provide the package "com.sun.script.javascript" in the
> > > system-bundle via custom.properties file of servicemix. That works fine
> > and
> > > the import-package-statement of my bundle seems to be fulfilled on
> bundle
> > > startup. But the error message on consumption remains, I guess because
> of
> > > different classloaders.
> > >
> > > How can I provide a javascript script-engine to the embedded Camel 2.9
> > > version. Is there an osgi-bundle I can also embed that provides the
> > engine?
> > >
> > > Thanks
> > > Stephan
> >
> >
> >
> > --
> > Claus Ibsen
> > -----------------
> > Red Hat, Inc.
> > Email: cibsen@redhat.com
> > Twitter: davsclaus
> > Blog: http://davsclaus.com
> > Author of Camel in Action: http://www.manning.com/ibsen
> > Make your Camel applications look hawt, try: http://hawt.io
> >
>
Re: JSR-233 and Camel-Script in OSGi environment (servicemix)
Posted by Richard Kettelerij <ri...@gmail.com>.
You say you only use "simple statements", are you referring to the simple
language (http://camel.apache.org/simple)? If so, you don't need to include
camel-script at all. The simple language is part of camel-core and doesn't
require any external dependencies, apart from OGNL which is optional.
On Fri, Dec 13, 2013 at 10:06 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> I suggest to find another way with SMX 4.5.x and wait for SMX 4.6
> which uses latest releases of all sorts. Usually OSGi is tricky and we
> fix once in a while some gremlins to get stuff working in OSGi. And
> Camel 2.9 is just too old.
>
>
>
> On Fri, Dec 13, 2013 at 9:44 AM, Stephan Burkard <sb...@gmail.com>
> wrote:
> > Hi Camel users
> >
> > Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our
> platform
> > version is currently 2.8 and that version suffers from a bug with
> > errorhandling.
> >
> > However, when the route of that bundle gets the first message,
> camel-script
> > tries to create a script engine for javascript (although I only use
> > simple-statements?!?). That fails with the error message "No script
> engine
> > could be created for: js".
> >
> > I tried to provide the package "com.sun.script.javascript" in the
> > system-bundle via custom.properties file of servicemix. That works fine
> and
> > the import-package-statement of my bundle seems to be fulfilled on bundle
> > startup. But the error message on consumption remains, I guess because of
> > different classloaders.
> >
> > How can I provide a javascript script-engine to the embedded Camel 2.9
> > version. Is there an osgi-bundle I can also embed that provides the
> engine?
> >
> > Thanks
> > Stephan
>
>
>
> --
> Claus Ibsen
> -----------------
> Red Hat, Inc.
> Email: cibsen@redhat.com
> Twitter: davsclaus
> Blog: http://davsclaus.com
> Author of Camel in Action: http://www.manning.com/ibsen
> Make your Camel applications look hawt, try: http://hawt.io
>
Re: JSR-233 and Camel-Script in OSGi environment (servicemix)
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
I suggest to find another way with SMX 4.5.x and wait for SMX 4.6
which uses latest releases of all sorts. Usually OSGi is tricky and we
fix once in a while some gremlins to get stuff working in OSGi. And
Camel 2.9 is just too old.
On Fri, Dec 13, 2013 at 9:44 AM, Stephan Burkard <sb...@gmail.com> wrote:
> Hi Camel users
>
> Unfortunately I had to embed Camel 2.9 in an OSGi bundle since our platform
> version is currently 2.8 and that version suffers from a bug with
> errorhandling.
>
> However, when the route of that bundle gets the first message, camel-script
> tries to create a script engine for javascript (although I only use
> simple-statements?!?). That fails with the error message "No script engine
> could be created for: js".
>
> I tried to provide the package "com.sun.script.javascript" in the
> system-bundle via custom.properties file of servicemix. That works fine and
> the import-package-statement of my bundle seems to be fulfilled on bundle
> startup. But the error message on consumption remains, I guess because of
> different classloaders.
>
> How can I provide a javascript script-engine to the embedded Camel 2.9
> version. Is there an osgi-bundle I can also embed that provides the engine?
>
> Thanks
> Stephan
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Make your Camel applications look hawt, try: http://hawt.io