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

FXMLLoader throws "LoadException: Page language not specified" when using jlink

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86_64
    • OS:
      generic

      Description

      ADDITIONAL SYSTEM INFORMATION :
      java version "10" 2018-03-20
      Java(TM) SE Runtime Environment 18.3 (build 10+46)
      Java HotSpot(TM) 64-Bit Server VM 18.3 (build 10+46, mixed mode)

      Same issue on MacOS.


      A DESCRIPTION OF THE PROBLEM :
      Compile and run the fxmlexample from command line/IDE.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      1. Compile and run the fxmlexample from command line/IDE. Make sure the dialog appears on screen.
      2. create a jlinked version (run `gradle link`) and run it (`./build/dist/bin/fxmlexample`).


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The same dialog as in step 1 appears on screen. Note that the exception says "Pange language not set" even if the FXML file contains "<?language javascript ?>".
      ACTUAL -
      An exception is thrown:

      $ ./build/dist/bin/fxmlexample
      Exception in Application start method
      java.lang.reflect.InvocationTargetException
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:564)
              at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(LauncherImpl.java:473)
              at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication(LauncherImpl.java:372)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:564)
              at java.base/sun.launcher.LauncherHelper$FXHelper.main(LauncherHelper.java:941)
      Caused by: java.lang.RuntimeException: Exception in Application start method
              at javafx.graphics/com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:973)
              at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication$2(LauncherImpl.java:198)
              at java.base/java.lang.Thread.run(Thread.java:844)
      Caused by: javafx.fxml.LoadException: Page language not specified.
      /fxmlexample/fxmlexample/fxml_example.fxml:68

              at javafx.fxml/javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2621)
              at javafx.fxml/javafx.fxml.FXMLLoader.access$100(FXMLLoader.java:105)
              at javafx.fxml/javafx.fxml.FXMLLoader$ScriptElement.processCharacters(FXMLLoader.java:1599)
              at javafx.fxml/javafx.fxml.FXMLLoader.processCharacters(FXMLLoader.java:2851)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2562)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2466)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3253)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3210)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3179)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3152)
              at javafx.fxml/javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:3129)
              at javafx.fxml/javafx.fxml.FXMLLoader.load(FXMLLoader.java:3122)
              at fxmlexample/fxmlexample.FXMLExample.start(FXMLExample.java:45)
              at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:919)
              at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$11(PlatformImpl.java:449)
              at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$9(PlatformImpl.java:418)
              at java.base/java.security.AccessController.doPrivileged(Native Method)
              at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:417)
              at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
              at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
              at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:175)
              ... 1 more
      Exception running application fxmlexample.FXMLExample


      ---------- BEGIN SOURCE ----------
      I created a minimal example derived from the original FXMLExample (JavaFX tutorial) which can be downloaded at https://github.com/xzel23/jlink-fxmlexample/archive/error.zip.

      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      None that I know of.

      FREQUENCY : always


        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: