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

FXML loader: bad exception returned in case of incorrect URL

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 7u40, 8
    • 8
    • javafx

    Description

      Look at the attached NB project.
      When the FXML file is opened with Scene Builder 1.1 (based on Fx 2.2), one get an FxmlParseException (see below).
      1) This does not really provide useful information to the user. Having a dedicated exception for URL resolution problem would be much better.
      2) It does not provide enough information to SB so that the tool can handle this correctly (by for instance opening the classpath setting panel, as we do with unknow classes for custom types)


      The exception raised:

      com.oracle.javafx.authoring.persist.FXMLDocument$FxmlParseException: Failed to load FXML file
      at com.oracle.javafx.authoring.persist.FXMLDocument.makeParseException(FXMLDocument.java:400)
      at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:311)
      at com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:239)
      at com.oracle.javafx.authoring.persist.FXMLDocument.checkLayout(FXMLDocument.java:224)
      at com.oracle.javafx.authoring.Project.forFxml(Project.java:835)
      at com.oracle.javafx.authoring.Project.forFxml(Project.java:807)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:197)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:185)
      at com.oracle.javafx.authoring.DesignerTool.commonInit(DesignerTool.java:513)
      at com.oracle.javafx.authoring.DesignerTool.initFromRemote(DesignerTool.java:436)
      at com.oracle.javafx.authoring.mbeans.SceneBuilderMgt$1.run(SceneBuilderMgt.java:31)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
      at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
      at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:96)
      at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:384)
      at com.sun.glass.ui.EventLoop.enter(EventLoop.java:83)
      at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:521)
      at javafx.stage.Stage.showAndWait(Stage.java:397)
      at com.oracle.javafx.authoring.util.dialog.AbstractModalDialog.showAndWait(AbstractModalDialog.java:84)
      at com.oracle.javafx.authoring.util.dialog.ErrorDialog.showDetailsDialog(ErrorDialog.java:72)
      at com.oracle.javafx.authoring.util.dialog.ErrorDialog.access$000(ErrorDialog.java:15)
      at com.oracle.javafx.authoring.util.dialog.ErrorDialog$1.run(ErrorDialog.java:30)
      at com.oracle.javafx.authoring.util.dialog.AlertDialog.actionButtonPressed(AlertDialog.java:72)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at sun.reflect.misc.Trampoline.invoke(MethodUtil.java:75)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at sun.reflect.misc.MethodUtil.invoke(MethodUtil.java:279)
      at javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1444)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
      at javafx.event.Event.fireEvent(Event.java:171)
      at javafx.scene.Node.fireEvent(Node.java:6867)
      at javafx.scene.control.Button.fire(Button.java:179)
      at com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:193)
      at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:336)
      at com.sun.javafx.scene.control.skin.SkinBase$4.handle(SkinBase.java:329)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:64)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      at com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:38)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:35)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      at javafx.event.Event.fireEvent(Event.java:171)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3311)
      at javafx.scene.Scene$MouseHandler.process(Scene.java:3151)
      at javafx.scene.Scene$MouseHandler.access$1900(Scene.java:3106)
      at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1563)
      at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2248)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:250)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:173)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:292)
      at com.sun.glass.ui.View.handleMouseEvent(View.java:530)
      at com.sun.glass.ui.View.notifyMouse(View.java:924)
      at com.sun.glass.ui.win.WinApplication._enterNestedEventLoopImpl(Native Method)
      at com.sun.glass.ui.win.WinApplication._enterNestedEventLoop(WinApplication.java:96)
      at com.sun.glass.ui.Application.enterNestedEventLoop(Application.java:384)
      at com.sun.glass.ui.EventLoop.enter(EventLoop.java:83)
      at com.sun.javafx.tk.quantum.QuantumToolkit.enterNestedEventLoop(QuantumToolkit.java:521)
      at javafx.stage.Stage.showAndWait(Stage.java:397)
      at com.oracle.javafx.authoring.util.dialog.AbstractModalDialog.showAndWait(AbstractModalDialog.java:84)
      at com.oracle.javafx.authoring.DesignerTool.showAndWaitDialog(DesignerTool.java:243)
      at com.oracle.javafx.authoring.DesignerTool.showLoadError(DesignerTool.java:267)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:232)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:185)
      at com.oracle.javafx.authoring.DesignerTool.commonInit(DesignerTool.java:513)
      at com.oracle.javafx.authoring.DesignerTool.init(DesignerTool.java:457)
      at com.oracle.javafx.authoring.SceneBuilderLauncher$RunningWithJMXInstance.launch(SceneBuilderLauncher.java:71)
      at com.oracle.javafx.authoring.Main.start(Main.java:72)
      at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:319)
      at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:216)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
      at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
      at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(WinApplication.java:17)
      at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:67)
      at java.lang.Thread.run(Thread.java:724)
      Caused by: java.lang.IllegalStateException
      at com.sun.javafx.fxml.builder.URLBuilder.build(URLBuilder.java:46)
      at com.sun.javafx.fxml.builder.URLBuilder.build(URLBuilder.java:17)
      at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:582)
      at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2464)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2169)
      at com.oracle.javafx.authoring.persist.FXMLDocument$2.call(FXMLDocument.java:301)
      at com.oracle.javafx.authoring.util.Utils.withFXMLDefaultClassLoader(Utils.java:2216)
      at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:298)
      ... 105 more

      Attachments

        Issue Links

          Activity

            People

              msladecek Martin Sládeček
              jcambon Jerome Cambon
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported: