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 119825 - java.io.NotSerializableException: Serializing component is invalid: org.netbeans.modules.java.JavaDataObject$JavaEditor[,0,0,607x366,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,
Summary: java.io.NotSerializableException: Serializing component is invalid: org.netbe...
Status: RESOLVED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Window System (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: mslama
URL: http://statistics.netbeans.org/except...
Keywords:
Depends on:
Blocks:
 
Reported: 2007-10-23 18:29 UTC by Jesse Glick
Modified: 2008-12-22 12:12 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 2045


Attachments
stacktrace (4.58 KB, text/plain)
2007-10-23 18:29 UTC, Jesse Glick
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Glick 2007-10-23 18:29:30 UTC
Build: NetBeans IDE Dev (Build 071023)
VM: Java HotSpot(TM) Client VM, 1.5.0_12-b04
OS: Linux, 2.6.22-14-generic, i386

User Comments:
Comment 1 Jesse Glick 2007-10-23 18:29:34 UTC
Created attachment 51518 [details]
stacktrace
Comment 2 Petr Nejedly 2007-10-23 21:40:49 UTC
Probably a winsys problem. I think this may happen in case you:

Start the IDE, open a.java, b.java, keep B selected
Shutdown the IDE
delete a.java
Start the IDE, it would show a.java, [b.java]
Exit the IDE.

Or in similar case where the IDE learns the fact that file in editor is no longer valid.

I have seen this before, IIRC....
Comment 3 Jesse Glick 2007-10-23 23:56:10 UTC
I think I simply had created a project, had some files open in it, then deleted it and shut down the IDE. Thrown many
times, so I can probably find a reproducible test case if you need one.
Comment 4 Jesse Glick 2007-10-24 01:01:29 UTC
Could this be a regression from the fix of issue #101700?
Comment 5 mslama 2007-10-24 06:30:13 UTC
I will look at it.
Comment 6 mslama 2007-10-24 06:39:49 UTC
I do not think it has anything to do with fix of #101700 as reports at are older. Yes some steps to reproduce this would
be useful. Anyway I can handle it without reproduction, just to verify fix. Steps from Petr would not work as if you
delete file when IDE does not run IDE will not open editor for deleted file - it will throw DataObjectNotFoundException.
Probably it is necessary to delete file for open but not selected editor.
Comment 7 Jesse Glick 2007-10-24 15:19:24 UTC
1. Run Basic IDE, fresh user dir, JDK 6, Ubuntu.

2. New Java Application in /tmp.

3. Select Projects tab. Select prj root node, Delete.

4. Also Delete Sources..., Yes.

5. Close main window.

=>

WARNING [org.netbeans.core.windows.persistence]: TopComponent Main is not serializable.
java.io.NotSerializableException: Serializing component is invalid:
org.netbeans.modules.java.JavaDataObject$JavaEditor[Main.java,1,0,838x781,invalid,layout=java.awt.BorderLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=256,maximumSize=,minimumSize=,preferredSize=]
	at org.openide.text.CloneableEditor.writeReplace(CloneableEditor.java:588)
[....]
	at org.openide.loaders.InstanceDataObject.convertorWriteMethod(InstanceDataObject.java:1416)
	at org.openide.loaders.InstanceDataObject.storeThroughConvertor(InstanceDataObject.java:1403)
	at org.openide.loaders.InstanceDataObject.storeSettings(InstanceDataObject.java:346)
	at org.openide.loaders.InstanceDataObject.access$900(InstanceDataObject.java:88)
	at org.openide.loaders.InstanceDataObject$Creator.run(InstanceDataObject.java:1366)
[....]
	at org.openide.loaders.InstanceDataObject$Creator.createInstanceDataObject(InstanceDataObject.java:1380)
	at org.openide.loaders.InstanceDataObject.create(InstanceDataObject.java:331)
	at org.openide.loaders.InstanceDataObject.create(InstanceDataObject.java:307)
[catch] at org.netbeans.core.windows.persistence.PersistenceManager.saveTopComponents(PersistenceManager.java:713)
	at org.netbeans.core.windows.persistence.PersistenceManager.saveWindowSystem(PersistenceManager.java:1101)
	at org.netbeans.core.windows.PersistenceHandler.save(PersistenceHandler.java:312)
	at org.netbeans.core.windows.WindowSystemImpl.save(WindowSystemImpl.java:76)
[....]
Comment 8 mslama 2007-10-24 15:50:20 UTC
First step is to lower log level of saving TCs from WARNING to INFO. Second step is to avoid saving closed TC when their
persistence type is PERSISTENCE_ONLY_OPENED.

Change log level:
/cvs/core/windows/src/org/netbeans/core/windows/persistence/PersistenceManager.java
new revision: 1.49; previous revision: 1.48
Comment 9 mslama 2007-10-24 20:57:34 UTC
When TC is closed it is saved (settings and wstcref) only when it has persistence type PERSISTENT_ALWAYS. It also fixes
this problem as when java file is deleted, editor TC is closed and as editor ahs persistence type PERSISTENT_ONLY_OPENED
winsys will not try to save editor TC.

Modified:
/cvs/core/windows/src/org/netbeans/core/windows/PersistenceHandler.java
new revision: 1.56; previous revision: 1.55

/cvs/core/windows/src/org/netbeans/core/windows/WindowManagerImpl.java
new revision: 1.70; previous revision: 1.69

/cvs/core/windows/src/org/netbeans/core/windows/persistence/PersistenceManager.java
new revision: 1.50; previous revision: 1.49