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.
Summary: | SystemAction does not declare serialVersionUID | ||
---|---|---|---|
Product: | obsolete | Reporter: | rrochat <rrochat> |
Component: | vcscore | Assignee: | 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
Please store names of SystemAction classes, not the instances themselves which are not really designed to be serializable. 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". Oh, why is this assigned to vcscore?? I forgot to reassign it ... Intentionally assigned here: you should not be attempting to serialize SystemAction instances. Save e.g. the class name if you have to store them. 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. 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.) *** Issue 26933 has been marked as a duplicate of this issue. *** 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.) 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. 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 I believe it's fixed. 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 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. 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 ---%<--- 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 Resolved for 3.4.x or earlier, no new info since then -> closing. |