Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8126554

javax.script.ScriptException: sun.misc.InvalidJarIndexException: Invalid index

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 7u6
    • fx2.1
    • deploy
    • Windows 7, x86

      I'm using Netbeans 7.1.2 to deploy a JavaFX application.

      In my application, i use Rhino to call some Java Code like this:
      Packages.com.ht.ActionUtil.fromScript();

      it works well in netbeans, but after i deploy it to a jar file, when i try to run it, it throws a Exception :

      javax.script.ScriptException: sun.misc.InvalidJarIndexException: Invalid index
      at com.sun.script.javascript.RhinoCompiledScript.eval(Unknown Source) ~[na:1.6.0_31]
      at javax.script.CompiledScript.eval(Unknown Source) ~[na:1.6.0_31]
      at com.ht.svg.action.ShowMenuAction$RTDAMenuItemModel.exeuteScript(ShowMenuAction.java:162) [ht-web-client.jar:1.0]
      at com.ht.svg.action.ShowMenuAction$RTDAMenuItemModel.access$200(ShowMenuAction.java:100) [ht-web-client.jar:1.0]
      at com.ht.svg.action.ShowMenuAction$RTDAMenuItemModel$2.run(ShowMenuAction.java:151) [ht-web-client.jar:1.0]
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_31]
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_31]
      at java.lang.Thread.run(Unknown Source) [na:1.6.0_31]
      Caused by: sun.misc.InvalidJarIndexException: Invalid index
      at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source) ~[na:1.6.0_31]
      at sun.misc.URLClassPath$JarLoader.getResource(Unknown Source) ~[na:1.6.0_31]
      at sun.misc.URLClassPath.getResource(Unknown Source) ~[na:1.6.0_31]
      at java.net.URLClassLoader$1.run(Unknown Source) ~[na:1.6.0_31]
      at java.security.AccessController.doPrivileged(Native Method) ~[na:1.6.0_31]
      at java.net.URLClassLoader.findClass(Unknown Source) ~[na:1.6.0_31]
      at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.6.0_31]
      at java.lang.ClassLoader.loadClass(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.Kit.classOrNull(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.NativeJavaPackage.getPkgProperty(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.NativeJavaPackage.get(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.ScriptableObject.getProperty(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.ScriptRuntime.getObjectProp(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.ScriptRuntime.getObjectProp(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.Interpreter.interpret(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.InterpretedFunction.call(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(Unknown Source) ~[na:1.6.0_31]
      at com.sun.script.javascript.RhinoScriptEngine$1.superDoTopCall(Unknown Source) ~[na:1.6.0_31]
      at com.sun.script.javascript.RhinoScriptEngine$1.doTopCall(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(Unknown Source) ~[na:1.6.0_31]
      at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(Unknown Source) ~[na:1.6.0_31]
      ... 8 common frames omitted

        1. dist.7z
          2.29 MB
          Chengwen Bo
        2. RhinoTest.7z
          1.68 MB
          Chengwen Bo

            kcr Kevin Rushforth
            cbojfx Chengwen Bo (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: