This discussion is archived
0 Replies Latest reply: Jun 19, 2012 11:37 PM by 943617 RSS

BufferedImage exception NotSerializableException

943617 Newbie
Currently Being Moderated
Hi i am getting this error
java.io.NotSerializableException: java.awt.image.BufferedImage
     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
     at java.io.ObjectOutputStream.writeArray(Unknown Source)
     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
     at java.io.ObjectOutputStream.defaultWriteFields(Unknown Source)
     at java.io.ObjectOutputStream.writeSerialData(Unknown Source)
     at java.io.ObjectOutputStream.writeOrdinaryObject(Unknown Source)
     at java.io.ObjectOutputStream.writeObject0(Unknown Source)
     at java.io.ObjectOutputStream.writeObject(Unknown Source)


when im doing this for 2nd time

FileOutputStream fileOut = new FileOutputStream(tempURFile);
ObjectOutputStream objOut = new ObjectOutputStream(fileOut);

objOut.writeObject(anObject);
fileOut.close();
objOut.close();



tempURFile is a final and static variable in my class

public static final File tempURFile = new File("tempfile");



please help me

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points