[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - Unable to load to deserialize result

morenito9000 do-not-reply at jboss.com
Mon Feb 19 05:54: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()
method).

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.

Ciao
Moreno

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

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



More information about the jboss-user mailing list