You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2011/04/14 15:54:05 UTC

[jira] [Commented] (CAMEL-3481) camel-script doesn't work in OSGi

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

Willem Jiang commented on CAMEL-3481:
-------------------------------------

Applied patch with thanks to Aaron.
I did some change on the patch of ScriptBuilder which leverage the Activator to detect the OSGi environment and moved the most reflection invocations into the Activator.

When I did some OSGi integration test on the script code, I just found using the org.apache.servicemix.specs.scripting-api-1.0 spec bundle code work around such issue, as the scripting api can find the script engine from OSGi rightly.

Anyway, current patch can help us to use the scripting api which provides by the JVM rightly.



> 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