• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1527
  • Last Modified:

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;
      }

}
0
poweranger77
Asked:
poweranger77
1 Solution
 
avinthmCommented:
can u post the complete stack trace ? i mean complete exception ?
0
 
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
 
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

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now