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

FXML + JavaScript fails with when exported

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Incomplete
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: javafx
    • Labels:
      None
    • Subcomponent:

      Description

      I've jused b42 to run this and it fails. When running from the IDE everything works as expected, packing up the stuff with the provided tooling it fails with an exception:

      C:\e-ws\runtime-EclipseApplication\EfxclipseTest\deploy\dist>java -jar Efxclipse
      Test.jar
      05.09.2011 21:47:57 javafx.fxml.FXMLLoader logException
      SCHWERWIEGEND: The following error occurred at line 15[Ljava.lang.StackTraceElem
      ent;@2ce908
      Exception in Application start method
      java.lang.reflect.InvocationTargetException
              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
      java:39)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:597)
              at com.javafx.main.Main.launchApp(Main.java:354)
              at com.javafx.main.Main.main(Main.java:468)
      Caused by: java.lang.RuntimeException: Exception in Application start method
              at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown So
      urce)
              at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
              at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
              at java.lang.Thread.run(Thread.java:662)
      Caused by: sun.misc.InvalidJarIndexException: Invalid index
              at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:858)
              at sun.misc.URLClassPath$JarLoader.getResource(URLClassPath.java:765)
              at sun.misc.URLClassPath.getResource(URLClassPath.java:169)
              at java.net.URLClassLoader$1.run(URLClassLoader.java:194)
              at java.security.AccessController.doPrivileged(Native Method)
              at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
              at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
              at sun.org.mozilla.javascript.internal.Kit.classOrNull(Kit.java:74)
              at sun.org.mozilla.javascript.internal.NativeJavaPackage.getPkgProperty(
      NativeJavaPackage.java:140)
              at sun.org.mozilla.javascript.internal.NativeJavaPackage.get(NativeJavaP
      ackage.java:91)
              at sun.org.mozilla.javascript.internal.ScriptableObject.getProperty(Scri
      ptableObject.java:1301)
              at sun.org.mozilla.javascript.internal.ScriptRuntime.getObjectProp(Scrip
      tRuntime.java:1326)
              at sun.org.mozilla.javascript.internal.ScriptRuntime.getObjectProp(Scrip
      tRuntime.java:1315)
              at sun.org.mozilla.javascript.internal.Interpreter.interpretLoop(Interpr
      eter.java:2804)
              at sun.org.mozilla.javascript.internal.Interpreter.interpret(Interpreter
      .java:2239)
              at sun.org.mozilla.javascript.internal.InterpretedFunction.call(Interpre
      tedFunction.java:138)
              at sun.org.mozilla.javascript.internal.ContextFactory.doTopCall(ContextF
      actory.java:323)
              at sun.org.mozilla.javascript.internal.ScriptRuntime.doTopCall(ScriptRun
      time.java:2747)
              at sun.org.mozilla.javascript.internal.InterpretedFunction.exec(Interpre
      tedFunction.java:149)
              at sun.org.mozilla.javascript.internal.Context.evaluateReader(Context.ja
      va:1169)
              at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.ja
      va:106)
              at com.sun.script.javascript.RhinoScriptEngine.eval(RhinoScriptEngine.ja
      va:124)
              at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:247)

              at javafx.fxml.FXMLLoader$ScriptElement.processEndElement(Unknown Source
      )
              at javafx.fxml.FXMLLoader.processEndElement(Unknown Source)
              at javafx.fxml.FXMLLoader.load(Unknown Source)
              at layouttests.fxml.sample1.FXMLSample1.start(Unknown Source)
              at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
              at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
              at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source)
              at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
              at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
              at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
              ... 1 more

      The offending content is:
      <fx:script>
        var USE_PREF_SIZE = Packages.javafx.scene.control.Control.USE_PREF_SIZE;
      </fx:script>

      when removed the fxml-File loads without problems. The fx-script was introduce because Greg Brown mentionned it in this blog post https://forums.oracle.com/forums/message.jspa?messageID=9842134#9842134

        Attachments

          Activity

            People

            Assignee:
            gkbrown Greg Brown (Inactive)
            Reporter:
            tschindl Tom Schindl
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported: