java.io.NotSerializableException:

what does the above exception mean?

i have a fingerprint template which i placed in an Object and trying to save into a Blob in Oracle. but i get that error

this is what i did

bos =new ByteArrayOutputStream();

oos =new ObjectOutputStream(bos);

oos.writeObject(fprint);

pstmt = con.prepareStatement("UPDATE T_FINGERPRINT SET FINGERPRINT_THUMB=? WHERE BADGENUM ='" +badge+"'");

pstmt.setBytes(1,bos.toByteArray());

rowcount = pstmt.executeUpdate();

this method of course implements the Serializable interface andfprintis of type Object

[725 byte] By [shuinia] at [2007-10-3 11:31:44]
# 1
Maybe you have a reference to a non serializable object within your fprint instance. Doesn't the exception contain the not serializable class name?Mike
bellyrippera at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 2
> this method of course implements the Serializable> interface and fprint is of type ObjectA method can't implement the Serializable interface, only a class can do that. fprint needs to be of a type that implements Serializable.
ejpa at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 3
oh sorryi meant that this class implements the Serializable interfacefprint is a private variable of type ObjectI am trying to save it as a blob using the code in my previous post and I can't save it and gives me that exception
shuinia at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 4

> Maybe you have a reference to a non serializable

> object within your fprint instance. Doesn't the

> exception contain the not serializable class name?

>

> Mike

Hi Mike

This class implements the Serializable interface

the Object is declared within the class as

private Object image=null;

in a method inside that class, a fingerprint template named fprint is put into the variable image as in fprint=image

and then saved as a blob in the database

shuinia at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 5
helpwhy do i get this NotSerializableException?
shuinia at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 6
Is image Serializable? It seems you mix method and field in your descriptions, please use the correct terms.Please post the complete exception trace.Mike
bellyrippera at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 7
what do you mean by is image serializable?how do i make objects serializable?i already implemented the serializable interfaceis it possible for an object to be not serializable?the object is an image templatemaybe its not serializable?
shuinia at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...
# 8

>what do you mean by is image serializable?

> how do i make objects serializable?

That's been answered.

> i already implemented the serializable interface

but not for the fprint object

> is it possible for an object to be not serializable?

yes

> the object is an image template

whatever that is

> maybe its not serializable?

I suggested that in reply #2. There's no 'maybe' about it, that's exactly what the exception is telling you.

ejpa at 2007-7-15 13:58:26 > top of Java-index,Java Essentials,New To Java...