File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes JBoss4 to JBoss6 - InvalidClassException on org.hibernate.proxy.pojo.javassist.SerializableProxy Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss4 to JBoss6 - InvalidClassException on org.hibernate.proxy.pojo.javassist.SerializableProxy" Watch "JBoss4 to JBoss6 - InvalidClassException on org.hibernate.proxy.pojo.javassist.SerializableProxy" New topic
Author

JBoss4 to JBoss6 - InvalidClassException on org.hibernate.proxy.pojo.javassist.SerializableProxy

lokesh sree
Ranch Hand

Joined: Oct 27, 2009
Posts: 99

Hi All,

I have an application which was running on JBoss4 and had some data serialized ( saved in database ).
Now, we migrated the application to JBoss6 with the serialized data retained. However, when reading one of the entities from this data, I am facing InvalidClassException.
The exception is similar to


I understand that this error can occur in case of serializing entities with a class and trying to deserialize it back with the same class(but with different serialversion uuid). The entity that I am trying to read has compatible changes. So, I believe there should not be any issue with my entity.
And, the exception also does not complain about my entity but rather complaining about the Hibernate class SerializableProxy being different.

Any ideas on what is wrong here and how I can resolve this?

Thanks,


Lokesh
( SCBCD 5, CCENT, SCJP 5 )
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5823
    
    7

I'll take a guess at this. Because you used Hibernate to store your data in the database, most likely your object was serialized as part of the SerializableProxy object. And now, because there is a more recent version of Hibernate in AS 6 than there was in 4 (which version of 4, they are all very different), you won't be able to access the object unless you run with the older version of Hibernate. This might involve packaging the older Hibernate JARS with your app and configuring a classloader repository. Then there is the issue with regard to how to update the database; for that I have no definitive answer (I can think of some ways, they are all ugly, and I have no idea if Hibernate provides a migration tool for such things).


JBoss In Action
lokesh sree
Ranch Hand

Joined: Oct 27, 2009
Posts: 99

Hi Peter,

Thanks for the response.
Even I was suspecting the issue is because of hibernate version change between JBoss6 and 4. But it is surprising to me as to how this backward compatibility can break as I believe there would be lots of people who would be migrating their applications(with data saved) to use newer versions of Hibernate or JBoss as such. May be I need to check in Hibernate forums as well..

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss4 to JBoss6 - InvalidClassException on org.hibernate.proxy.pojo.javassist.SerializableProxy