JDK-8094610 : Unable to open *.fxml file
  • Type: Bug
  • Component: javafx
  • Sub-Component: tools-scenebuilder
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Duplicate
  • Submitted: 2014-01-03
  • Updated: 2015-06-12
  • Resolved: 2014-01-03
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8Resolved
Related Reports
Duplicate :  
Description
Please see http://youtrack.jetbrains.com/issue/IDEA-118667 for details

java.io.IOException: javafx.fxml.LoadException: 
/C:/Users/benjamin/IdeaProjects/JavaFXApp/src/sample/login.fxml:19

    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:86)
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.<init>(FXOMDocument.java:74)
    at com.oracle.javafx.scenebuilder.kit.editor.EditorController.updateFxomDocument(EditorController.java:1731)
    at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:583)
    at com.oracle.javafx.scenebuilder.app.DocumentWindowController.loadFromFile(DocumentWindowController.java:344)
    at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performOpenFiles(SceneBuilderApp.java:431)
    at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleOpenFilesAction(SceneBuilderApp.java:304)
    at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleLaunch(SceneBuilderApp.java:290)
    at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStartGeneric(AppPlatform.java:139)
    at com.oracle.javafx.scenebuilder.app.AppPlatform.requestStart(AppPlatform.java:106)
    at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.start(SceneBuilderApp.java:234)
    at com.sun.javafx.application.LauncherImpl$8.run(LauncherImpl.java:837)
    at com.sun.javafx.application.PlatformImpl$7.run(PlatformImpl.java:331)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:297)
    at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:294)
    at java.security.AccessController.doPrivileged(Native Method)
    at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:294)
    at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
    at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
    at com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
    at com.sun.glass.ui.win.WinApplication$4$1.run(WinApplication.java:112)
    at java.lang.Thread.run(Thread.java:744)
Caused by: javafx.fxml.LoadException: 
/C:/Users/benjamin/IdeaProjects/JavaFXApp/src/sample/login.fxml:19

    at javafx.fxml.FXMLLoader.constructLoadException(FXMLLoader.java:2596)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2574)
    at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2404)
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:83)
    ... 21 more
Caused by: java.lang.IllegalStateException
    at com.oracle.javafx.scenebuilder.kit.fxom.TransientObject.makeFxomObject(TransientObject.java:156)
    at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.endElement(FXOMLoader.java:262)
    at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2821)
    at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2511)
    ... 23 more
Comments
Closing as a duplicate of DTL-6181.
03-01-2014

The GridPane in login.fxml declares its "children" components without specifying the "children" element. This is valid FXML because "children" is the default property of the GridPane class. However SB2 currently has an issue with default properties (see DTL-6181). As a temporary workaround, simply insert <children></children> between GridPane and its child components. This should allow SB2 to load the file correctly.
03-01-2014

The file was created in IntelliJ IDEA. Moreover IntelliJ IDEA has an inspection to remove default children tag as it is (or was?) redundant, the completion would allow to add subtags skipping default tags. etc.
03-01-2014

Can be reproduced with SB 2 trunk (changeset 1786e60ae01e). I noticed within the fxml we miss the <children> ... </children> enclosing for elements put in the GridPane. Did you create the login.fxml file by hand or using SceneBuilder ? Attaching a modified version of your file where I only added missing <children> ... </children>: with such a fix on board it opens fine.
03-01-2014

Trying to open this fxml file from the latest SB I get the following assertion : Exception in thread "JavaFX Application Thread" java.lang.AssertionError at com.oracle.javafx.scenebuilder.kit.fxom.TransientObject.makeFxomObject(TransientObject.java:156) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.endElement(FXOMLoader.java:269) at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2836) at javafx.fxml.FXMLLoader.loadImpl(FXMLLoader.java:2526) at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2419) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMLoader.load(FXOMLoader.java:89) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.<init>(FXOMDocument.java:75) at com.oracle.javafx.scenebuilder.kit.editor.EditorController.updateFxomDocument(EditorController.java:1738) at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:545) at com.oracle.javafx.scenebuilder.app.DocumentWindowController.loadFromFile(DocumentWindowController.java:347) at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performOpenFiles(SceneBuilderApp.java:432) at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performOpenFile(SceneBuilderApp.java:381) at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performControlAction(SceneBuilderApp.java:135) at com.oracle.javafx.scenebuilder.app.menubar.MenuBarController$ApplicationControlActionController.perform(MenuBarController.java:1446) at com.oracle.javafx.scenebuilder.app.menubar.MenuBarController.handleOnActionMenu(MenuBarController.java:990) at com.oracle.javafx.scenebuilder.app.menubar.MenuBarController.access$800(MenuBarController.java:89) at com.oracle.javafx.scenebuilder.app.menubar.MenuBarController$15.handle(MenuBarController.java:983) at com.oracle.javafx.scenebuilder.app.menubar.MenuBarController$15.handle(MenuBarController.java:979) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.event.Event.fireEvent(Event.java:204)
03-01-2014

Attached the fxml file causing the issue (from the jetbrains bug)
03-01-2014