[jboss-user] [Beginners Corner] - Unable to load to deserialize result

morenito9000 do-not-reply at jboss.com
Mon Feb 19 05:53:08 EST 2007

Hi all,
I store attachments file (like jpg, bmp, doc, pdf) inside a db table (postgresql db, column type is BYTEA).

Insert is performed via a Stateful SessionBean that uses an Entity Bean.
(at Entity Level the db column is mapped using the generic Object class).

Insert is ok.

When I try to read the attachments I use a Stateless SessioBean
that calls a DAO Class (inside DAO Class, JDBC code:
"select column from table ...." then I apply resulSet.getObject()

Reading is ok.

But when I try to remove the attachment (EntityBean remove() method)
I get a strange exception.

  | ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackLocalException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy:
  | java.sql.SQLException: Unable to load to deserialize result: java.io.StreamCorruptedException: invalid stream header

I think it's something related to serialization.
Object class is not the proper class I must use to map a BYTEA DB column ?

I use JBOSS 3.2.3 and Postgesql 7.4.5.

Any help is very very appreciated.
Thank you for your help.


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018749#4018749

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018749

More information about the jboss-user mailing list