JavaFX scene builder fails to open files that use custom components

Answered

(Context: IntelliJ CE 2020.2.3 on a Mac)

I have defined a custom component which extends controlsfx's WizardPane and I'm using it in a .fxml file. When I try to open the file in Scene Builder I get the message: "Failed to open the file in the Scene Builder" and a link "Download JavaFX" (that seem to do nothing):

In the log there's the following stack trace:

SceneBuilderEditor - 
java.lang.AssertionError
at com.oracle.javafx.scenebuilder.kit.metadata.klass.ComponentClassMetadata.getSubComponentProperty(ComponentClassMetadata.java:129)
at com.oracle.javafx.scenebuilder.kit.metadata.klass.ComponentClassMetadata.getSubComponentProperty(ComponentClassMetadata.java:75)
at com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyMask.getSubComponentPropertyName(DesignHierarchyMask.java:623)
at com.oracle.javafx.scenebuilder.kit.metadata.util.DesignHierarchyMask.isAcceptingSubComponent(DesignHierarchyMask.java:540)
at com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.AbstractHierarchyPanelController.updateTreeItem(AbstractHierarchyPanelController.java:942)
at com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.AbstractHierarchyPanelController.makeTreeItem(AbstractHierarchyPanelController.java:648)
at com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.AbstractHierarchyPanelController.updateTreeItems(AbstractHierarchyPanelController.java:768)
at com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.treeview.HierarchyTreeViewController.updatePanel(HierarchyTreeViewController.java:94)
at com.oracle.javafx.scenebuilder.kit.editor.panel.hierarchy.AbstractHierarchyPanelController.fxomDocumentDidChange(AbstractHierarchyPanelController.java:488)
at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractPanelController.lambda$new$0(AbstractPanelController.java:90)
at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:360)
at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80)
at javafx.beans.property.ObjectPropertyBase.fireValueChangedEvent(ObjectPropertyBase.java:106)
at javafx.beans.property.ObjectPropertyBase.markInvalid(ObjectPropertyBase.java:113)
at javafx.beans.property.ObjectPropertyBase.set(ObjectPropertyBase.java:147)
at javafx.beans.property.ObjectProperty.setValue(ObjectProperty.java:72)
at com.oracle.javafx.scenebuilder.kit.editor.EditorController.updateFxomDocument(EditorController.java:2515)
at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:710)
at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:695)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderImpl.loadFile(SceneBuilderImpl.java:279)
at org.jetbrains.plugins.javaFX.sceneBuilder.SceneBuilderImpl.create(SceneBuilderImpl.java:102)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)

At runtime the FXML file loads my custom component correctly, so I know the file is OK.

Additionally, .fxml files that only contain standard components can be opened with the embedded Scene Builder without a problem.

Any idea?

4 comments
Comment actions Permalink

Hello Olivier,

Could you please provide the whole idea.log file?

You can upload it to https://uploads.jetbrains.com/ and provide the upload id.

0
Comment actions Permalink

Here it is: Upload id: 2020_10_24_RUEUupZr1Nr9Dghj (file: idea.log)

I noticed that just before the AssertionError there is a ClassNotFoundException for this specific class. Is there something to do to add the project's classes to SceneBuilder's classpath ?

0
Comment actions Permalink

Thank you Olivier.

I created a new bug report for this on our issue tracker: IDEA-253834. The developers will look into it shortly.

Feel free to leave additional comments and follow the issue for further updates from the dev team.

See this article if you are not familiar with YouTrack.

Please also provide the .fxml file for analysis if possible. You can attach it to your comment on YouTrack privately (visibility reduced to jetbrains-team).

0
Comment actions Permalink

Thanks, issue updated with requested information.

0

Please sign in to leave a comment.