JDK-8094671 : Scene Builder crashes when using custom control
  • Type: Bug
  • Component: javafx
  • Sub-Component: tools-scenebuilder
  • Affected Version: 8
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2014-04-29
  • Updated: 2015-06-12
  • Resolved: 2014-10-15
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
8u40Fixed
Related Reports
Relates :  
Relates :  
Description
- imported custom control "UTextFld" to Scene Builder (import JAR/FXML file)
- custom control is displayed correctly in "custom" area
- when custom control is dragged to content area, Scene Builder freezes for some seconds, after that the Scene Builder main window is automatically closed



fxml-file of custom control:

<?xml version="1.0" encoding="UTF-8"?>

<?import java.lang.*?>
<?import javafx.scene.control.*?>
<?import javafx.scene.layout.*?>

<fx:root type="javafx.scene.layout.HBox" xmlns:fx="http://javafx.com/fxml">
	<Label text="Label1" />
	<Label text="Label2" />
</fx:root>



java-file of custom control:

package com.unitechnik;

import java.io.IOException;

import javafx.fxml.*;
import javafx.scene.control.TextField;
import javafx.scene.layout.HBox;

public class UTextFld extends HBox 
{
    @FXML private TextField textField;

    public UTextFld() 
    {
        FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("/com/unitechnik/UTextFld.fxml"));
        fxmlLoader.setRoot(this);
        fxmlLoader.setController(this);

        try {
            fxmlLoader.load();
        } catch (IOException exception) {
            throw new RuntimeException(exception);
        }
    }
}

Comments
I think we've made what was to be done on this one. Do not hesitate to reopen it in the case I missed something.
15-10-2014

I logged DTL-6890 as part of my investigation.
23-09-2014

Re-assigning to Yves for further investigations.
29-04-2014

Ok thanks. Three things: 1) your initial FXML (without <children> tags) is valid : it's Scene Builder 2.0 b14 which is buggy ; it has been fixed (see DTL-6181) ; this fix is integrated in the final release which is not yet on the web unfortunately (hopefully soon). 2) I agree that Scene Builder should not break and even refuse an invalid custom component ; in fact, it already performs multiple verifications ; we need to check why those ones failed to detect the pb ; so I will keep this pb open until we get an answer. 3) despite #2, Scene Builder will never claim it can resist to any possible custom component ; executing foreign code in Scene Builder jvm will always put it at risk ; safety will be a responsability shared between Scene Builder and the custom component.
29-04-2014

Scene Builder is not crashing anymore with the patched FXML file (as I already indicated in my last comment). I'm sorry that I caused confusion because of an invalid FXML file. Nevertheless it would IMHO be better, if Scene Builder would not crash, but would already deny to import the invalid custom control into its library.
29-04-2014

Could you patch your FXML like this and redo your test ? <?xml version="1.0" encoding="UTF-8"?> <?import java.lang.*?> <?import javafx.scene.control.*?> <?import javafx.scene.layout.*?> <fx:root type="javafx.scene.layout.HBox" xmlns:fx="http://javafx.com/fxml"> <children> <Label text="Label1" /> <Label text="Label2" /> </children> </fx:root>
29-04-2014

Sorry i missed the FXML. Thanks for the log data. Stay tuned.
29-04-2014

The FXML file is contained in the issue description. I'm sorry, but the FXML file itself is invalid. The children-tag between HBox- and Label-tags is missing. Nevertheless Scene Builder should IMHO not crash when using the custom control, but should already deny to import the invalid custom control into the library. There are some exceptions in the logfile, I don't know if they belong to the issue: Apr 28, 2014 3:08:01 PM com.oracle.javafx.scenebuilder.app.SceneBuilderApp$SceneBuilderUncaughtExceptionHandler uncaughtException SCHWERWIEGEND: An exception was thrown: java.lang.UnsupportedOperationException: name=html, publicId=-//W3C//DTD XHTML 1.0 Transitional//EN, systemId=http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd at com.oracle.javafx.scenebuilder.kit.fxom.glue.GlueLoader.startDTD(GlueLoader.java:232) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.doctypeDecl(AbstractSAXParser.java:342) at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.doctypeDecl(XMLDTDValidator.java:724) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.scanDoctypeDecl(XMLDocumentScannerImpl.java:670) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:929) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:117) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213) at com.oracle.javafx.scenebuilder.kit.fxom.glue.GlueLoader.load(GlueLoader.java:89) at com.oracle.javafx.scenebuilder.kit.fxom.glue.GlueLoader.load(GlueLoader.java:75) at com.oracle.javafx.scenebuilder.kit.fxom.glue.GlueDocument.<init>(GlueDocument.java:54) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMDocument.<init>(FXOMDocument.java:74) at com.oracle.javafx.scenebuilder.kit.editor.EditorController.updateFxomDocument(EditorController.java:2373) at com.oracle.javafx.scenebuilder.kit.editor.EditorController.setFxmlTextAndLocation(EditorController.java:626) at com.oracle.javafx.scenebuilder.app.DocumentWindowController.loadFromFile(DocumentWindowController.java:388) at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.performOpenFiles(SceneBuilderApp.java:531) at com.oracle.javafx.scenebuilder.app.SceneBuilderApp.handleOpenFilesAction(SceneBuilderApp.java:399) at com.oracle.javafx.scenebuilder.app.AppPlatform$MessageBoxDelegate$1.run(AppPlatform.java:189) at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:301) at com.sun.javafx.application.PlatformImpl$6$1.run(PlatformImpl.java:298) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:298) 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) Apr 28, 2014 1:02:13 PM com.oracle.javafx.scenebuilder.app.SceneBuilderApp$SceneBuilderUncaughtExceptionHandler uncaughtException SCHWERWIEGEND: An exception was thrown: java.lang.NullPointerException at com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance.<init>(FXOMInstance.java:94) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance.newInstance(FXOMInstance.java:136) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMNodes.newObject(FXOMNodes.java:161) at com.oracle.javafx.scenebuilder.kit.fxom.FXOMNodes.newDocument(FXOMNodes.java:238) at com.oracle.javafx.scenebuilder.kit.editor.job.DuplicateSelectionJob.makeSubJobs(DuplicateSelectionJob.java:85) at com.oracle.javafx.scenebuilder.kit.editor.job.v2.CompositeJob.getSubJobs(CompositeJob.java:64) at com.oracle.javafx.scenebuilder.kit.editor.job.v2.CompositeJob.isExecutable(CompositeJob.java:84) at com.oracle.javafx.scenebuilder.kit.editor.EditorController.canPerformEditAction(EditorController.java:1144) at com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController$EditActionController.canPerform(ContextMenuController.java:505) at com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController.handleOnShowing(ContextMenuController.java:224) at com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController.access$000(ContextMenuController.java:60) at com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController$2.handle(ContextMenuController.java:124) at com.oracle.javafx.scenebuilder.kit.editor.util.ContextMenuController$2.handle(ContextMenuController.java:119) 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.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) 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) at javafx.stage.Window.fireEvent(Window.java:1024) at javafx.stage.Window$9.invalidated(Window.java:722) at javafx.beans.property.BooleanPropertyBase.markInvalid(BooleanPropertyBase.java:109) at javafx.beans.property.BooleanPropertyBase.set(BooleanPropertyBase.java:143) at javafx.stage.Window.setShowing(Window.java:826) at javafx.stage.Window.show(Window.java:841) at javafx.stage.PopupWindow.showImpl(PopupWindow.java:446) at javafx.stage.PopupWindow.show(PopupWindow.java:415) at javafx.scene.control.ContextMenu.doShow(ContextMenu.java:286) at javafx.scene.control.ContextMenu.show(ContextMenu.java:278) at javafx.scene.control.Control$1.handle(Control.java:178) at javafx.scene.control.Control$1.handle(Control.java:171) at com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) 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.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) 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.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) 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:54) at javafx.event.Event.fireEvent(Event.java:204) at javafx.scene.Scene.processMenuEvent(Scene.java:1735) at javafx.scene.Scene.access$4500(Scene.java:201) at javafx.scene.Scene$ScenePeerListener.menuEvent(Scene.java:2508) at com.sun.javafx.tk.quantum.GlassViewEventHandler$1.run(GlassViewEventHandler.java:361) at com.sun.javafx.tk.quantum.GlassViewEventHandler$1.run(GlassViewEventHandler.java:357) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMenuEvent(GlassViewEventHandler.java:357) at com.sun.glass.ui.View.handleMenuEvent(View.java:534) at com.sun.glass.ui.View.notifyMenu(View.java:850) 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) Apr 28, 2014 1:49:19 PM com.oracle.javafx.scenebuilder.app.SceneBuilderApp$SceneBuilderUncaughtExceptionHandler uncaughtException SCHWERWIEGEND: An exception was thrown: java.lang.ClassCastException: com.oracle.javafx.scenebuilder.kit.fxom.FXOMCollection cannot be cast to com.oracle.javafx.scenebuilder.kit.fxom.FXOMInstance at com.oracle.javafx.scenebuilder.kit.editor.panel.content.driver.AbstractNodeDriver.makeHandles(AbstractNodeDriver.java:98) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.mode.EditModeController.updateHandles(EditModeController.java:447) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.mode.EditModeController.updateHandles(EditModeController.java:383) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.mode.EditModeController.editorSelectionDidChange(EditModeController.java:187) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.ContentPanelController.editorSelectionDidChange(ContentPanelController.java:736) at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractPanelController$6.changed(AbstractPanelController.java:228) at com.oracle.javafx.scenebuilder.kit.editor.panel.util.AbstractPanelController$6.changed(AbstractPanelController.java:225) at com.sun.javafx.binding.ExpressionHelper$Generic.fireValueChangedEvent(ExpressionHelper.java:347) at com.sun.javafx.binding.ExpressionHelper.fireValueChangedEvent(ExpressionHelper.java:80) at javafx.beans.property.IntegerPropertyBase.fireValueChangedEvent(IntegerPropertyBase.java:106) at javafx.beans.property.IntegerPropertyBase.markInvalid(IntegerPropertyBase.java:113) at javafx.beans.property.IntegerPropertyBase.set(IntegerPropertyBase.java:146) at com.oracle.javafx.scenebuilder.kit.editor.selection.Selection.incrementRevision(Selection.java:503) at com.oracle.javafx.scenebuilder.kit.editor.selection.Selection.endUpdate(Selection.java:471) at com.oracle.javafx.scenebuilder.kit.editor.selection.Selection.select(Selection.java:387) at com.oracle.javafx.scenebuilder.kit.editor.selection.Selection.select(Selection.java:144) at com.oracle.javafx.scenebuilder.kit.editor.selection.Selection.select(Selection.java:123) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse.SelectWithMarqueeGesture.updateSelection(SelectWithMarqueeGesture.java:217) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse.SelectWithMarqueeGesture.mouseDragged(SelectWithMarqueeGesture.java:98) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse.AbstractMouseGesture$1$1.handle(AbstractMouseGesture.java:115) at com.oracle.javafx.scenebuilder.kit.editor.panel.content.gesture.mouse.AbstractMouseGesture$1$1.handle(AbstractMouseGesture.java:111) 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.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) 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.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) 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:54) at javafx.event.Event.fireEvent(Event.java:204) at javafx.scene.Scene$MouseHandler.process(Scene.java:3746) at javafx.scene.Scene$MouseHandler.access$1800(Scene.java:3471) at javafx.scene.Scene.impl_processMouseEvent(Scene.java:1695) at javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2486) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:314) at com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:243) at java.security.AccessController.doPrivileged(Native Method) at com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:345) at com.sun.glass.ui.View.handleMouseEvent(View.java:526) at com.sun.glass.ui.View.notifyMouse(View.java:898) 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)
29-04-2014

Could you provide your FXML file (UTextFld.fxml) ? Also if you could have a look in Scene Builder log file: log file path is given in the About dialog of scene builder. There might be some info helping to understand what's happening. Thanks.
29-04-2014