You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Paul McCulloch (JIRA)" <ji...@apache.org> on 2016/01/19 00:09:39 UTC

[jira] [Commented] (CAMEL-7122) javascript language not resolving

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

Paul McCulloch commented on CAMEL-7122:
---------------------------------------

I'm seeing what [~pm10] is reporting as well, this time in Karaf 2.4.3 with Camel 2.16.0 (Oracle JDK 1.8.0/64bit/Windows 7). It's transient for me as well, but only seems to occur after I delete the data/cache directory.  I install camel-script-javascript via a features.xml entry in the deploy directory.

I've done a fair bit of debugging into org.apache.camel.script.osgi.Activator.BundleScriptEngineResolver.getFactory() where the IsAssignableFrom check that [~pm10] mention is done. The classLoader of javax.script.ScriptEngineFactory is null when the issue occurs. I believe this is dues to that class being provided by the bootstrap classloader, which provides v0.0.0 of javax.script.

When the issue isn't occurring javax.script is being loaded from the bundle org.apache.servicemix.specs.scripting-api-1.0 which exports v1.0.0 of that package. That bundle is part of the camel-script-javascript feature.

camel-script doesn't import a specific version of javax.script which I think is at least part of the issue.

My workaround is to edit Karaf's jre.properties and remove javax.script from the list of JVM provided packages, so the servicemix provided bundle is the only provider of the problematic package.

> javascript language not resolving
> ---------------------------------
>
>                 Key: CAMEL-7122
>                 URL: https://issues.apache.org/jira/browse/CAMEL-7122
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-script, osgi
>    Affects Versions: 2.10.0
>         Environment: JBoss Fuse 6.0.0, windows
>            Reporter: Steve Murphy
>            Assignee: Claus Ibsen
>            Priority: Minor
>              Labels: javascript
>             Fix For: 2.12.3, 2.13.0
>
>
> .when().javascript("3 > 1 + 1") causes bundle not to be loaded, with the following error:
> ERROR | BluePrinntContainerImpl | Bundle my-service is waiting for dependencies
> [(&(language=js)(objectClass=org.apache.camel.spi.LanguageResolver))]
> It seems that the javascript language is not registered correctly.
> Adding a custom Activator to register languages found by all ScriptEngineFactory's, and registering Rhino engine as "js" instead of "ECMAScript" seems to solve the problem.
> This problem is in 2.10.0. I have no idea if it has been fixed in other versions.
> Can someone please check .javascript() functionality in 2.11? Since if it has indeed been fixed in future versions, then this bug can be closed :)
> Workaround posted here:
> http://stackoverflow.com/questions/20997276/jboss-fuse-apache-camel-wont-resolve-language-js-javascript-for-bundle



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)