java.io.NotSerializableException

i have this error, how can i resovled this:

Caused by: java.io.NotSerializableException: com.mysql.jdbc.Blob

this is the object class:

import java.io.Serializable;
import java.sql.Blob;
import java.util.Date;

public class IncidentObject implements Serializable {

      public IncidentObject() {

      }

      private Blob attachment;

      private Blob xml_parse_date;

      /**
       * @return Returns the attachment.
       */
      public Blob getAttachment()   {
            return attachment;
      }

      /**
       * @return Returns the xml_parse_date.
       */
      public Blob getXml_parse_date() {
            return xml_parse_date;
      }

}
poweranger77Asked:
Who is Participating?
 
TimYatesCommented:
    private Blob attachment;

You can't serialize a Blob

You have two choices...

1) change the Blob into a serializable datatype (byte array?)
2) Don't serialize out the blob field:

     private transient Blob attachment;

will stop the serializer running on it

Tim
0
 
avinthmCommented:
can u post the complete stack trace ? i mean complete exception ?
0
 
poweranger77Author Commented:
ok. i dont understand what doest it mean by serialized the BLOB?

this error will only prompt when i keep my application server running and i am trying to amend the program code in Eclipse development platform.

what is this serialized? means?

and also, how can i transfrom this BLOB datatype to another form of datatype such as String?

TimYates, can you help to share you view in this thread?
http://www.experts-exchange.com/Web/Web_Languages/JSP/Q_21780229.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.