-
Bug
-
Resolution: Fixed
-
P3
-
1.3.0
-
kestrel
-
sparc
-
solaris_2.5.1
Name: avC70361 Date: 06/23/99
A java.awt.Frame instance cannot be serialized in kestrel when the instance has a java.awt.Button
added. An unexpected exception is thrown : java.io.NotSerializableException: sun.awt.X11GraphicsConfig.
Here is a test demonstrating the bug.
---------------FrameTest.java--------------
import java.awt.Button;
import java.awt.Frame;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
public class FrameTest {
public static void main(String args[]) {
Frame frame = new Frame("frame");
frame.add(new Button("button"));
ObjectOutputStream stream = null;
try {
stream = new ObjectOutputStream(new ByteArrayOutputStream());
stream.writeObject(frame);
stream.close();
System.out.println("OK");
} catch (IOException e) {
System.out.println("Failed. Couldn't write " + frame + " : " + e);
}
System.exit(0);
}
}
-----------The test output---------
> java FrameTest
Failed. Couldn't write java.awt.Frame[frame0,0,0,0x0,invalid,hidden,layout=java.awt.BorderLayout,resizable,title=frame] : java.io.NotSerializableException: sun.awt.X11GraphicsConfig
======================================================================
- relates to
-
JDK-4247520 Kestrel H fails api/java_awt/serialization/descriptions.html#Window,#Container
- Closed