ScriptEngineManager fails with multiple META-INF files in same jar

XMLWordPrintable

    • Type: Bug
    • Resolution: Won't Fix
    • Priority: P4
    • None
    • Affects Version/s: 6u15
    • Component/s: core-libs

      FULL PRODUCT VERSION :
      $ java -version
      java version "1.6.0_15"
      Java(TM) SE Runtime Environment (build 1.6.0_15-b03)
      Java HotSpot(TM) Client VM (build 14.1-b02, mixed mode, sharing)

      $ java -version
      java version "1.7.0-ea"
      Java(TM) SE Runtime Environment (build 1.7.0-ea-b73)
      Java HotSpot(TM) Client VM (build 17.0-b02, mixed mode, sharing)

      ADDITIONAL OS VERSION INFORMATION :
      Not OS specific

      A DESCRIPTION OF THE PROBLEM :
      See example maven project attached to the issue:

      http://jira.codehaus.org/browse/JRUBY-4057


      If both jruby and jython are enabled using runtime dependencies*

      pom.xml:
      <dependencies>
       <dependency>
        <groupId>org.jruby</groupId>
        <artifactId>jruby</artifactId>
        <version>1.4.0RC1</version>
        <scope>runtime</scope>
       </dependency>
       <dependency>
        <groupId>org.python</groupId>
        <artifactId>jython</artifactId>
        <version>2.5.1</version>
        <scope>runtime</scope>
       </dependency>
      </dependencies>

      then the jar-with-dependencies assembly jar will fail to register both ScriptEngine implementations

      $ mvn assembly:assembly
      $ java -jar target/example-1.0-SNAPSHOT-jar-with-dependencies.jar
      could not find jruby engine

      whereas creating an explicit classpath works fine

      $ java -classpath "jython-2.5.1.jar;jruby-1.4.0RC1.jar;target/example-1.0-SNAPSHOT.jar" example.Jsr223Example
      ok

      It appears the JSR223 mechanism cannot handle multiple copies of its metadata in example-1.0-SNAPSHOT-jar-with-dependencies.jar.

      $ jar tvf target/example-1.0-SNAPSHOT-jar-with-dependencies.jar | grep javax.script.ScriptEngineFactory
      42 Wed Sep 16 13:39:46 CDT 2009 META-INF/services/javax.script.ScriptEngineFactory
      40 Sat Sep 26 13:48:04 CDT 2009 META-INF/services/javax.script.ScriptEngineFactory

          * - please note a jython-2.5.1.jar artifact is not yet available on maven central repo, will have to be installed manually

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      See description above

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      $ mvn assembly:assembly
      $ java -jar target/example-1.0-SNAPSHOT-jar-with-dependencies.jar
      ok
      ACTUAL -
      $ mvn assembly:assembly
      $ java -jar target/example-1.0-SNAPSHOT-jar-with-dependencies.jar
      could not find jruby engine

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      See example maven project attached to the issue:

      http://jira.codehaus.org/browse/JRUBY-4057
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Workaround would be to not use the maven assembly plugin to build a jar-with-dependencies jar, which is not possible for out project.

            Assignee:
            Sundararajan Athijegannathan
            Reporter:
            Ting-Yun Ingrid Yao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: