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

Hendy Irawan commented on CAMEL-3481:
-------------------------------------

In my experience, "the ScriptEngineManager that ScriptBuilder uses can't find 
any scripting engines except the ones packaged in the JDK" seems incorrect 
assumption, at least on ServiceMix 4.3.0 / Camel 2.6.0, as I got this:

09:39:26,649 | ERROR | rint Extender: 2 | BlueprintContainerImpl           | 7 
- org.apache.aries.blueprint - 0.2.0.incubating | Unable to start blueprint 
container for bundle marioteguh-to-tumblr_v2.blueprint.xml due to unresolved 
dependencies 
[(&(language=simple)(objectClass=org.apache.camel.spi.LanguageResolver)), 
(&(component=rss)(objectClass=org.apache.camel.spi.ComponentResolver)), 
(&(language=js)(objectClass=org.apache.camel.spi.LanguageResolver)), 
(&(component=smtp)(objectClass=org.apache.camel.spi.ComponentResolver))]
java.util.concurrent.TimeoutException
        at 
org.apache.aries.blueprint.container.BlueprintContainerImpl$1.run(BlueprintContainerImpl.java:273)[7:org.apache.aries.blueprint:0.2.0.incubating]
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.6.0_22]
        at 
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)[:1.6.0_22]
        at java.util.concurrent.FutureTask.run(FutureTask.java:166)[:1.6.0_22]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$101(ScheduledThreadPoolExecutor.java:165)[:1.6.0_22]
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:266)[:1.6.0_22]
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)[:1.6.0_22]
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)[:1.6.0_22]
        at java.lang.Thread.run(Thread.java:679)[:1.6.0_22]

This seems to be the culprit:

  (&(language=js)(objectClass=org.apache.camel.spi.LanguageResolver))

I can confirm that there seems to be no bundle that exports this service:

camel-script (210) provides:
----------------------------
language = 
objectClass = org.apache.camel.spi.LanguageResolver
service.id = 350
----
objectClass = org.apache.camel.spi.LanguageResolver
resolver = default
service.id = 351

I reported this as bug SMXCOMP-895.

> camel-script doesn't work in OSGi
> ---------------------------------
>
>                 Key: CAMEL-3481
>                 URL: https://issues.apache.org/jira/browse/CAMEL-3481
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-script
>    Affects Versions: 2.5.0
>            Reporter: Aaron Mulder
>            Assignee: Willem Jiang
>             Fix For: 2.8.0
>
>         Attachments: camel-core.patch, camel-script.patch
>
>
> In an OSGi environment, the ScriptEngineManager that ScriptBuilder uses can't 
> find any scripting engines except the ones packaged in the JDK (Rhino, maybe 
> AppleScript, etc.).  It's possible that setting a better ClassLoader would 
> work, or perhaps using a singleton ScriptEngineManager and setting up the 
> scripting engines in an OSGi Activator instead of relying on the META-INF 
> lookup every time a script is invoked.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to