scripting
  1. scripting
  2. SCRIPTING-15

getEngineByName("pnuts") returns null

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: current
    • Fix Version/s: milestone 1
    • Component/s: www
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      15

      Description

      I am unable to create a Pnuts ScriptEngine using the JSR 223 API. The code
      below reports that the pnuts interpreter could not be found.

      ScriptEngineManager manager = new ScriptEngineManager();
      ScriptEngine engine = manager.getEngineByName("pnuts");
      if (engine == null)

      { throw new RuntimeException("Could not find pnuts interpreter for use with JSR 223"); }

      else

      { System.out.println("Found pnuts interpreter for use with JSR 223"); }

      I am using the pnuts-jsr223.jar from a May 21 2007 download of
      jsr223-engines.zip, together with the latest stable 1.1 or 1.2 pnuts.jar and
      pnuts-modules.jar from pnuts.dev.java.net

      The problem appears to be a packaging issue introduced some time in the last
      year. When I use a pnuts-jsr223.jar from last year, the code above works well.

      Inside META-INF of the older, working jar I find a services directory with a
      good registration for the PnutsScriptEngineFactory, plus the manifest below.

      Manifest-Version: 1.0
      Ant-Version: Apache Ant 1.6.5
      Created-By: 1.5.0_06-b05 (Sun Microsystems Inc.)
      Specification-Title: Pnuts Script Engine for JSR223
      Specification-Version: 1.0
      Specification-Vendor: Sun Microsystems, Inc.
      Implementation-Title:
      Implementation-Version: 20060502120728
      Implementation-Vendor: Sun Microsystems, Inc.

      Inside META-INF of the newer, broken jar I find the registation of
      PnutsScriptEngineFactory misplaced in services\META-INF\services, plus an empty
      manifest:

      Manifest-Version: 1.0
      Ant-Version: Apache Ant 1.6.5
      Created-By: 1.6.0-rc-b102 (Sun Microsystems Inc.)

        Activity

        Hide
        tomatsu added a comment -

        Fixed the ant script. Resulting pnuts-jsr223.jar should be identical to the one
        from pnuts.org.

        Show
        tomatsu added a comment - Fixed the ant script. Resulting pnuts-jsr223.jar should be identical to the one from pnuts.org.

          People

          • Assignee:
            scripting-issues
            Reporter:
            lyogman
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: