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 26491

Summary: SystemAction does not declare serialVersionUID
Product: obsolete Reporter: rrochat <rrochat>
Component: vcscoreAssignee: Martin Entlicher <mentlicher>
Status: CLOSED FIXED    
Severity: blocker CC: jglick, jtulach, mihmax, non_migrated_user
Priority: P4    
Version: 3.x   
Hardware: PC   
OS: Windows ME/2000   
Issue Type: DEFECT Exception Reporter:

Description rrochat 2002-08-13 22:17:10 UTC
After restarting 3.4RC1, I saw the following in 
the console:
-----------
Serializable class 
org.openide.util.actions.SystemAction does not 
declare serialVersionUID field. Encountered while 
storing: 
[org.openide.windows.TopComponent$Replacer, 
java.lang.Short, java
.lang.Number, 
org.netbeans.core.ui.MountNode$CapNode$CapHandle, 
org.netbeans.modules.vcs.advanc
ed.CommandLineVcsFileSystem, 
org.netbeans.modules.vcscore.VcsFileSystem, 
org.openide.filesystem
s.AbstractFileSystem, 
org.openide.filesystems.FileSystem, 
org.openide.filesystems.FileSystemCap
ability$Bean, 
org.netbeans.modules.vcscore.VcsAttributes, 
org.openide.filesystems.DefaultAttrib
utes, 
org.netbeans.modules.vcscore.VcsActionSupporter, 
java.util.HashMap, org.netbeans.modules.
vcscore.actions.HistoryCommandAction, 
org.netbeans.modules.vcscore.actions.GeneralComma
ndAction
, org.openide.util.actions.NodeAction, 
org.openide.util.actions.CallableSystemAction] 
See also
http://www.netbeans.org/issues/show_bug.cgi?id=19
915 [may have been writing Windows/Components/
untitled_tc.settings]
=================
I skimmed that bug and its friends and didn't 
follow it all, but assume you want this fixed or 
you wouldn't be printing out the message.
Feel free to close this if it's not really a bug.
Comment 1 Jesse Glick 2002-08-23 01:55:16 UTC
Please store names of SystemAction classes, not the instances
themselves which are not really designed to be serializable.
Comment 2 Jesse Glick 2002-09-02 16:44:19 UTC
fbrunnerlist@gmx.ch on nbusers writes:

---%<---
when mounting or unmounting a subdirectory in v3.4 I get following
exception:
Cannot read class: org.netbeans.modules.treefs.TreeFS

This didn't happen viwth v3.3.2!

Note: The filesystems ar mounted/ unmounted anyway, but the error
message is a bit annoying.
---%<---
Hmm, in the "show Details" part it's written somewhere:
java.io.InvalidClassException: org.openide.util.actions.SystemAction;
local class incompatible: stream classdesc serialVersionUID =
7131978192935797459, local class serialVersionUID = -8361232596876856810
---%<---

See thread "[nb 3.4] TreeFS exceptions".
Comment 3 Martin Entlicher 2002-09-02 17:02:54 UTC
Oh, why is this assigned to vcscore?? I forgot to reassign it ...
Comment 4 Jesse Glick 2002-09-02 18:10:45 UTC
Intentionally assigned here: you should not be attempting to serialize
SystemAction instances. Save e.g. the class name if you have to store
them.
Comment 5 Martin Entlicher 2002-09-02 18:38:08 UTC
O.K., understand.
The problem is in VcsActionSupporter. The similar problem might be in
javacvs as well.
GeneralCommandAction serializes AWT and Swing components! That should
be avoided as well.
Comment 6 Jesse Glick 2002-09-02 22:20:11 UTC
Definitely serializing AWT/Swing components should be avoided as it
will cause JDK upgrade problems.

I will add a SVUID to SystemAction in the trunk. However it will only
provide compat for serialized actions from NB 3.4, and then only with
openide-compat.jar at the front of the classpath (i.e. kept in
lib/patches/). Too late to make it compat with 3.3. It is better if no
one tries to use this, but technically it implements Serializable (all
SharedClassObject's do) so it is supposed to have a SVUID just in
case. (The replacer just stores the class name plus any data that
might have been written by writeExternal.)
Comment 7 _ rkubacki 2002-09-03 09:01:02 UTC
*** Issue 26933 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2002-09-05 08:12:34 UTC
I just added openide/src/META-INF/netbeans/translate.names to the
trunk with an identity translation for SystemAction. Yarda claims this
will prevent any further SVUID problems, even for pre-3.4.

Since it seems that this causes actual exceptions sometimes, we might
want to fix this in a hypothetical 3.4.1. I have not tested whether it
really permits old (e.g. 3.3) SystemAction sers to be deserialized
without complaint. That depends further on whether the concrete action
subclass declares an SVUID correctly. (The abstract subclasses in
org.openide.util.actions.* already do, curiously.)
Comment 9 Martin Entlicher 2002-09-11 18:15:28 UTC
The new treefs module does not serialize the delegating filesystem, so
this issue should not appear now. However I'm going to disable the
serialization of SystemAction anyway.
Comment 10 Martin Entlicher 2002-09-11 19:38:01 UTC
Fixed in the main trunk.
The system actions are not serialized with the filesystem and
GeneralCommandAction does not serializes AWT and Swing components any
more.

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java,v 
<--  GeneralCommandAction.java
new revision: 1.18; previous revision: 1.17

/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAttributes.java,v 
<--  VcsAttributes.java
new revision: 1.20; previous revision: 1.19
Comment 11 Jiri Kovalsky 2002-09-16 13:04:01 UTC
I believe it's fixed.
Comment 12 Jesse Glick 2002-10-04 15:48:37 UTC
Re. openide's translate.names, I had to also patch openide/build.xml,
since it was not including this file in openide.jar. So if this fix is
ever merged to 3.4, should include:

- whatever changes to vcscore

- added SVUID to SystemAction (actual value irrelevant, I guess)

- META-INF/netbeans/translate.names added to openide.jar with identity
transformation for org.openide.util.actions.SystemAction
Comment 13 Jaroslav Tulach 2002-12-03 09:53:55 UTC
Hi. This issue is marked as 3.4.1_CANDIDATE. It means that it should be
integrated into release341 one branch. The plan at
http://www.netbeans.org/devhome/docs/releases/34/index.html expected beta1 to be
produced on Dec01. That did not happen due to a lot of outstanding not
integrated candidates like this one. 

Would it be possible to spend few minutes by backporting this fix? Thank you in
advance.
Comment 14 Jesse Glick 2002-12-03 16:35:16 UTC
Don't forget my Oct 04 comment re. openide.jar containing:

---%<--- META-INF/netbeans/translate.names
org.openide.util.actions.SystemAction=org.openide.util.actions.SystemAction
---%<---
Comment 15 Martin Entlicher 2002-12-06 14:58:57 UTC
Merged into release341 branch.

/cvs/vcscore/src/org/netbeans/modules/vcscore/actions/GeneralCommandAction.java,v 
<--  GeneralCommandAction.java
new revision: 1.17.54.1; previous revision: 1.17
/cvs/vcscore/src/org/netbeans/modules/vcscore/VcsAttributes.java,v 
<--  VcsAttributes.java
new revision: 1.19.26.1; previous revision: 1.19

/cvs/openide/src/META-INF/netbeans/translate.names,v  <-- 
translate.names
new revision: 1.1.40.1; previous revision: 1.1
Comment 16 Quality Engineering 2003-07-01 12:57:05 UTC
Resolved for 3.4.x or earlier, no new info since then -> closing.