JDK-4025021 : Images can't be serialized
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.1,1.1.3
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • OS:
    solaris_2.5,solaris_2.5.1,windows_95,windows_nt solaris_2.5,solaris_2.5.1,windows_95,windows_nt
  • CPU: generic,unknown,x86,sparc
  • Submitted: 1997-01-09
  • Updated: 1998-05-21
  • Resolved: 1998-05-21
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Duplicate :  
Description
Although the java.awt.Image abstract class is marked serializeable, image objects can not be serialized.

Several customers have bumped into this over the last few days; there have been
other similar reports:

From ###@###.### Tue Jan  7 03:44:01 1997
Mime-Version: 1.0
To: ###@###.### (Roger Riggs - JavaSoft East)
From: MASSIMO CARLI <###@###.###>
Subject: Image Serialization error


HI,
i have an error when i try to save, with serialization, an image object. The
error is

Java.io.NetSerializableException  in sun.awt.image.ImageRappresentation


Please help me

                                                Thank you
**********************************************************
***     Dott. Ing.Massimo Carli                        ***
***     Java and Internet Developer                    ***
***     Via B.da Garofolo 5                            ***
***     45100 Rovigo                                   ***
***     tel. +39 425 362885                            ***
***          (0338) 7372320                            ***
***     email : ###@###.###                   ***
***     iphone: ###@###.###     *** 
***                                                    ***
**********************************************************


From: Luciano Ongaro <###@###.###>
Sender: "A mailing list for discussion of JavaSoft's Remote Method
              Invocation" <###@###.###>
To: Multiple recipients of list RMI-USERS <###@###.###>
Subject:      Image Serialization
Date:         Thu, 9 Jan 1997 13:58:18 +0000

Hi,
please tell me if something is moving about Image serialization.

                                        Thank You
                                        Luciano Ongaro


From: "Daniel B." <###@###.###>
Sender: "A mailing list for discussion of JavaSoft's Remote Method
              Invocation" <###@###.###>
To: Multiple recipients of list RMI-USERS <###@###.###>
Subject:      Image not serialized????
Date:         Thu, 9 Jan 1997 09:47:34 -0600

Just ran up against a problem last night.
It seems that despite an Image being marked as Serailizable
the undlying implementation (1.1b2) has data in it that is NOT
serialized.  I get a serialization exception for the representation
of the image.

Is there a way to work around this omission?

Is JavaSoft going to fix it? Or do they see it as some cross platform
feature that they will not support?

Dan



Comments
EVALUATION [jim.graham@Eng 1997-01-24] Unfortunately, all of the internal implementation details of images are platform dependent and so we can't serialize Image objects without making them heavily platform and release dependent. It would be better to simply decommit from serializable images for 1.1 and remove the "Serializable" interface tag from Image. Name: rrT76497 Date: 05/20/98 R Chandrasekar / SIPtech May 20, 1998 This is not a bug as Image does not implement serializable. ======================================================================
11-06-2004

WORK AROUND Make image fields transient and user read/writeObject to load and store images by name.
11-06-2004