This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 256129

Summary: Warning about missing zero-argument constructor in element should explain what's the reason for failure
Product: guibuilder Reporter: kalle1
Component: CodeAssignee: issues@guibuilder <issues>
Status: NEW ---    
Severity: normal    
Priority: P3    
Version: 8.0.2   
Hardware: PC   
OS: Linux   
Issue Type: ENHANCEMENT Exception Reporter:

Description kalle1 2015-10-23 09:39:33 UTC
After removing a (necessary) zero-argument constructor from a component used in another GUI builder form (e.g `JFrame`) NetBeans displays a warning dialog

    Error in loading component: [JPanel]->queryPanel
    Cannot create instance of richtercloud.reflection.form.builder.jpa.panels.QueryPanel.
    The component cannot be loaded.

    Error in loading layout: [JPanel]->[layout]
    Failed to initialize layout of this container.

    Errors occurred in loading the form data. It is not recommended to use
    this form now in editable mode - data that could not be loaded would be lost after saving the form.
    Please go through the reported errors, try to fix them if possible, and open the form again.
    If you choose to open the form as View Only you may see which beans are missing.

asking to allow editing or providing a read-only view with the stacktrace

    java.lang.InstantiationException: richtercloud.reflection.form.builder.jpa.panels.QueryPanel
	    at java.lang.Class.newInstance(Class.java:364)
	    at org.netbeans.modules.form.CreationFactory.createDefaultInstance(CreationFactory.java:178)
	    at org.netbeans.modules.form.RADComponent.createBeanInstance(RADComponent.java:252)
	    at org.netbeans.modules.form.RADComponent.initInstance(RADComponent.java:191)
	    at org.netbeans.modules.form.GandalfPersistenceManager.restoreComponent(GandalfPersistenceManager.java:780)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:968)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:503)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:283)
	    at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:352)
	    at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
	    at org.openide.util.Mutex.doEventAccess(Mutex.java:1376)
	    at org.openide.util.Mutex.readAccess(Mutex.java:327)
	    at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
	    at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:349)
	    at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:467)
	    at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
	    at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
	    at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
	    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
	    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
	    at java.awt.EventQueue.access$300(EventQueue.java:103)
	    at java.awt.EventQueue$3.run(EventQueue.java:706)
	    at java.awt.EventQueue$3.run(EventQueue.java:704)
	    at java.security.AccessController.doPrivileged(Native Method)
	    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	    at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
	    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
    java.io.IOException: Undefined component referenced in layout: queryPanel
	    at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.correctMissingName(LayoutPersistenceManager.java:736)
	    at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.loadLayout(LayoutPersistenceManager.java:413)
	    at org.netbeans.modules.form.layoutdesign.LayoutPersistenceManager.loadContainer(LayoutPersistenceManager.java:379)
	    at org.netbeans.modules.form.layoutdesign.LayoutModel.loadContainerLayout(LayoutModel.java:1231)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadComponent(GandalfPersistenceManager.java:998)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:503)
	    at org.netbeans.modules.form.GandalfPersistenceManager.loadForm(GandalfPersistenceManager.java:283)
	    at org.netbeans.modules.form.FormEditor$2.run(FormEditor.java:352)
	    at org.netbeans.modules.form.FormLAF$2.run(FormLAF.java:293)
	    at org.openide.util.Mutex.doEventAccess(Mutex.java:1376)
	    at org.openide.util.Mutex.readAccess(Mutex.java:327)
	    at org.netbeans.modules.form.FormLAF.executeWithLookAndFeel(FormLAF.java:276)
	    at org.netbeans.modules.form.FormEditor.loadFormData(FormEditor.java:349)
	    at org.netbeans.modules.nbform.FormEditorSupport.loadOpeningForm(FormEditorSupport.java:467)
	    at org.netbeans.modules.nbform.FormDesignerTC.loadForm(FormDesignerTC.java:279)
	    at org.netbeans.modules.nbform.FormDesignerTC.access$300(FormDesignerTC.java:87)
	    at org.netbeans.modules.nbform.FormDesignerTC$PreLoadTask$1.run(FormDesignerTC.java:268)
	    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
	    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
	    at java.awt.EventQueue.access$300(EventQueue.java:103)
	    at java.awt.EventQueue$3.run(EventQueue.java:706)
	    at java.awt.EventQueue$3.run(EventQueue.java:704)
	    at java.security.AccessController.doPrivileged(Native Method)
	    at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	    at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
	    at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

It could just test for the necessary constructor and explain that it's missing.