JDK-4288811 : in appletSave: java.io.NotSerializableException occurs on win32 and solaris
  • Type: Enhancement
  • Component: tools
  • Sub-Component: appletviewer
  • Affected Version: 1.3.0
  • Priority: P5
  • Status: Closed
  • Resolution: Won't Fix
  • OS: generic,solaris_7
  • CPU: generic,sparc
  • Submitted: 1999-11-08
  • Updated: 2017-12-13
  • Resolved: 2017-12-13
Related Reports
Duplicate :  
Relates :  
Description
java.io.NotSerializableException occurs in applet save.

by kestrel fcs, kestrel beta, jdk1.2.2 jdk1.2 on both of solaris and win32.


***The demos of in which the Exception occrus are blow;

C:\tmp\TicTacToe>appletviewer example1.html
in applet save:java.io.NotSerializableException: sun.awt.windows.WImag

C:\tmp\Animator>appletviewer example1.html
in applet save:java.io.NotSerializableException: Animation

C:\tmp\MoleculeViewer>appletviewer example1.html
in applet save:java.io.NotSerializableException: Matrix3D

C:\tmp\Blink>appletviewer example1.html
in applet save:java.io.NotSerializableException: java.util.Timer

C:\tmp\SpreadSheet>appletviewer example1.html
in applet save:java.io.NotSerializableException: Cell

C:\tmp\Fractal>appletviewer example1.html
in applet save:java.io.NotSerializableException: ContextLSystem

C:\tmp\GraphicsTest>appletviewer example1.html
in applet save:java.io.NotSerializableException: OvalShape

C:\tmp\GraphLayout>appletviewer example1.html
in applet save:java.io.NotSerializableException: Edge

C:\tmp\ImageMap>appletviewer example1.html
in applet save:java.io.NotSerializableException: SoundArea


To reproduce, please run any of the applets above with appletviewer and
save it.

Comments
WORK AROUND Do not attempt to save the applet if any of the classes in its inheritance chain do not implement java.io.Serializable. This workaround is realistically almost impossible since since classes that implement java.awt.Image are typically not serializable by design. iris.garcia@eng 1999-12-03
03-12-1999

EVALUATION AppletViewer is attempting to save the demo by serializing all of the classes in use. If a class or any of the classes in its inheritance chain does not implement java.io.Serializable, then the class is not serializable and the NotSerializableException will be thrown. This does not represent a problem with AppletViewer. It's a problem with the implementation of the demos which were never designed with serialization in mind. A few of these demos are having problems with classes in the JDK which are not serializable (e.g. sun.awt.windows.WImage -- see bug 4025021, and java.util.Timer). The other demos all contain classes which have not been serialized by the demo-writer. Note that the class java.lang.Object (the superclass of all the problem demo classes) does not implement java.io.Serializable, thus leaving the task of serialization to the actual demo implementation. It would be less confusing to the user if the exception message was modified to a more helpful message indicating that serialization is not possible due to use of the noted class. If a partial serialized file has already been created, it should be removed. iris.garcia@eng 1999-11-08 The final paragraph in the previous evaluation describes the correct solution to this problem and as such, this should be considered an RFE. iris.garcia@eng 2000-08-21
08-11-1999