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 148761 - Unable to (de)serialize components with Swing App Framework's action assigned
Summary: Unable to (de)serialize components with Swing App Framework's action assigned
Status: RESOLVED WONTFIX
Alias: None
Product: guibuilder
Classification: Unclassified
Component: App Framework (show other bugs)
Version: 6.x
Hardware: All All
: P4 blocker (vote)
Assignee: issues@guibuilder
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-30 15:58 UTC by Jana Maleckova
Modified: 2011-09-07 09:33 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
148761 (3.97 KB, text/plain)
2008-09-30 16:01 UTC, Jana Maleckova
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jana Maleckova 2008-09-30 15:58:57 UTC
Product Version: NetBeans IDE Dev (Build 20080930010732)
Java: 1.6.0_10-rc2; Java HotSpot(TM) Client VM 11.0-b15
System: Windows XP version 5.1 running on x86; Cp1252; en_GB (nb)

Description:
============
have frame in a scope of JDA project
1. place jButton
2. assign some action to this button.
3. set Code Generation property of this button as Serialize
4. reopen this form => AE with following NPE is thrown
Form arranged this way is not possible to design => P1 but workaround is to set Code Generation property back => P2

StackTrace:
===========
java.lang.AssertionError
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:266)
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.fillGroup(SwingLayoutBuilder.java:253)
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.composeGroup(SwingLayoutBuilder.java:232)
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.createLayout(SwingLayoutBuilder.java:174)
	at org.netbeans.modules.form.layoutdesign.support.SwingLayoutBuilder.setupContainerLayout(SwingLayoutBuilder.java:107)
Comment 1 Jana Maleckova 2008-09-30 16:01:27 UTC
Created attachment 70914 [details]
148761
Comment 2 Jan Stola 2008-09-30 16:29:06 UTC
In fact, the original exception is

java.lang.ClassNotFoundException: org.netbeans.modules.swingapp.ProxyAction
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at org.openide.execution.NbClassLoader.findClass(NbClassLoader.java:209)
        at org.netbeans.api.java.classpath.ClassLoaderSupport.findClass(ClassLoaderSupport.java:114)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
        at java.beans.ObjectInputStreamWithLoader.resolveClass(Beans.java:515)
        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at javax.swing.event.EventListenerList.readObject(EventListenerList.java:255)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1947)
        at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
        at javax.swing.JComponent.readObject(JComponent.java:5382)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
        at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1849)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
        at java.beans.Beans.instantiate(Beans.java:165)
        at java.beans.Beans.instantiate(Beans.java:48)
[catch] at org.netbeans.modules.form.RADComponent.createDefaultDeserializedInstance(RADComponent.java:381)
        ...
Comment 3 Jan Stola 2008-09-30 16:41:01 UTC
The serialization of Swing components has a lot of drawbacks. Hence, it is not recommended. In fact, the support of 
serialization in GUI Builder remains because of legacy reasons only (e.g. to be able to open some very old forms that 
possibly use it). It doesn't have any sense to use serialization in connection with Swing application framework.

I have modified the corresponding code to make sure that it is possible to open such a strange form, but the attributes 
of the problematic component will not be loaded (e.g. it will behave as any serialized component before issue 147103 
was fixed). Hence, I am keeping this issue opened as P4 defect.

Modified file: http://hg.netbeans.org/main/rev/fcff5dc097ca
Comment 4 Jan Stola 2011-09-07 09:33:59 UTC
NetBeans support of Swing Application Framework has been discontinued => I am closing this issue as 'will not fix'.