You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Daniel Kulp (JIRA)" <ji...@apache.org> on 2011/06/03 19:57:47 UTC

[jira] [Created] (CAMEL-4047) javax.script dependency in camel-core

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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Jean-Baptiste Onofré (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044050#comment-13044050 ] 

Jean-Baptiste Onofré commented on CAMEL-4047:
---------------------------------------------

My preference is more on the 2/ because I think it's the most secure way.

It requires:
- to exclude javax.script from the system package (by tuning the jre.properties file)
- add the ServiceMix Specs bundle in the feature

Like this, we can guarantee that it works, which is more hazardous just flagging the javax.script package as optional.

> 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044067#comment-13044067 ] 

Daniel Kulp commented on CAMEL-4047:
------------------------------------


The other option MAY be to move all  the javax.script stuff into the camel-script component.  It already has a bundle Activator in there that could handle this.   

That said, I'm not 100% sure if that's acceptable as there COULD be use cases of the script things without camel-script.   Thoughts?


> 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

[jira] [Assigned] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CAMEL-4047:
----------------------------------

    Assignee: Daniel Kulp

> 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
>            Assignee: 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044157#comment-13044157 ] 

Hadrian Zbarcea commented on CAMEL-4047:
----------------------------------------

+1. This sounds great, camel-script SHOULD be used with jsr-223 languages.

> 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13044044#comment-13044044 ] 

Hadrian Zbarcea commented on CAMEL-4047:
----------------------------------------

More I think about it, more my head spins... I agree 2) would completely solve the problem, but it is the right solution?

We cannot use the jre version of the ScriptEngineFactory in an OSGi deployment, that much is clear. Both 1) and 2) do not have *any* impact on non-OSGi deployments, so we're good there.

Assumption (*): There is a fair percentage of deployments that do *not* need/use a script engine (say x%).

Solution 2) brings the extra feature dependency for the camel-core on all *osgi* deployments. If x is relatively small e.g. x <= 20, I don't think it's a big problem, especially given the meager 32k the extra bundle is bringing.

If x is larger, say x >= 80, would it make sense to make the dependency optional? Of course we then have the problem Dan explained. We can get activation to fail for things like camel-bean-validator if camel-core was using the jre version of the ScriptEngine. 3rd party component writers would have to be aware of that too.

I don't know it may be overkill for just the 32k... On the plus side, we should be able to reach a consensus quickly on this though.



> 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13043918#comment-13043918 ] 

Hadrian Zbarcea commented on CAMEL-4047:
----------------------------------------

Dan, thanks for reporting this!
I don't see 2) as being an option and have a strong preference towards 1).

> 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ 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

[jira] [Resolved] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Hadrian Zbarcea resolved CAMEL-4047.
------------------------------------

       Resolution: Fixed
    Fix Version/s: 2.8.0

Fixed in r1133232. Thanks Dan for patch and keep them coming.

> 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
>            Assignee: Daniel Kulp
>             Fix For: 2.8.0
>
>         Attachments: CAMEL-4047.patch
>
>
> 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

[jira] [Commented] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Hadrian Zbarcea (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13045736#comment-13045736 ] 

Hadrian Zbarcea commented on CAMEL-4047:
----------------------------------------

@Dan, patch looks good. I started a full test and will commit when done (could take a while...). Thanks for the contribution.

> 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
>            Assignee: Daniel Kulp
>         Attachments: CAMEL-4047.patch
>
>
> 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

[jira] [Updated] (CAMEL-4047) javax.script dependency in camel-core

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CAMEL-4047?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp updated CAMEL-4047:
-------------------------------

    Attachment: CAMEL-4047.patch


May need to use "git apply" to apply the patch due to the removal of a file.

I've tested a bit in a standalone OSGi container (TSF) installing the camel-script feature and such.   However, I haven't been able to run the camel-ittest-osgi stuff yet due to them being broken.

> 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
>            Assignee: Daniel Kulp
>         Attachments: CAMEL-4047.patch
>
>
> 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