JDK-4030693 : Image cannot be serialized, ImageRepresentation not Serializable
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_nt
  • CPU: x86
  • Submitted: 1997-02-06
  • Updated: 1997-02-06
  • Resolved: 1997-02-06
Related Reports
Duplicate :  
Description

Name: mc57594			Date: 02/06/97


This is pseudocode...

I create a memory image from a Frame:

Frame frame = new Frame()
frame.addNotify();
Image image = frame.createImage(100, 200);

After painting in the image I try to serialize it:

mImageOutput.reset();              // reset ByteArrayOutputStream
mObjectOutput.writeObject(mImage); // write to ObjectOutputStream

When attempting to writeObject the image an exception is thrown.
Here is part of the stack trace:

java.io.NotSerializableException: sun.awt.image.ImageRepresentation
        at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:576)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:221)
        at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:320)
        at java.io.ObjectOutputStream.outputObject(ObjectOutputStream.java:623)
        at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:221)

company  -  Panda Systems Inc.  , email  -  ###@###.###
======================================================================

Comments
WORK AROUND Name: mc57594 Date: 02/06/97 I am unawere of a workaround. This is a show-stopper for me. ======================================================================
11-06-2004