[ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043968#comment-13043968 ]
Daniel Kulp commented on CAMEL-4047: ------------------------------------ Actually, #2 is really the correct solution to this. In OSGi, the smx scripting-api jar is really the version of the API jar with the factory (ScriptEngineMaker) that works in OSGi. You cannot really use the in-jdk versions. This is the same as all the other api jars we use. Thus, we need to make sure we depend on that version up front in the features file. Otherwise, you can end up with a path like: {code} features:install ....camel-core... {code} which would depend on the in-jdk version. Then, later, I install something like camel-bean-validator or something else that would pull in the smx api version. Any scripting engine installed after that will result in classcasts in camel as the javax.script classes will be different as the new bundles will get the smx version and Camel will expect the in-jdk version. > javax.script dependency in camel-core > ------------------------------------- > > Key: CAMEL-4047 > URL: https://issues.apache.org/jira/browse/CAMEL-4047 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 2.8.0 > Reporter: Daniel Kulp > > The OSGi imports for camel-core ends up with a non-optional dependency on > javax.script due to it being used in the Activator. However, the karaf > feature for camel-core doesn't have a dependency on > org.apache.servicemix.specs.scripting-api-1.0 . > One of two things should be done: > 1) mark javax.script as optional. This MAY require some updates to the > Activator to work when it's not available. > 2) Update the karaf features file to add: > {code:xml} > <bundle > dependency="true">mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.scripting-api-1.0/${servicemix-specs-version}</bundle> > {code} -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira