[jboss-user] [JBoss Cache Users] - Serialization problem using JDBC cache loader and MySQL

drcallaway do-not-reply at jboss.com
Mon Oct 12 20:30:06 EDT 2009


I am running into a problem when deserializing objects stored in the JBoss Cache via the JDBC cache loader. I can start the cache, load objects into it, and read objects from it without a problem. The objects that I have stored in the cache specifically set the serialVersionUID variable to 1. This all works fine until I shutdown and restart the cache. At this point, I get this error when attempting to access a node:

[JDBCCacheLoader] Failed to load node for fqn /mynode java.lang.Exception:
  | Unable to load to deserialize result:
  | Caused by: java.io.InvalidClassException: com.company.generated.MyNode; local class incompatible:
  | stream classdesc serialVersionUID = 1, local class serialVersionUID = -7258818124315218931

According to this error, it looks like the version of the class stored in the database has a UID of 1 (which is correct). However, it then indicates that the local class has a UID of -7258818124315218931. Why is JBoss generating a UID when the local class already specifies a serialVersionUID of 1? After all, it was the exact same version of this local class that was stored in the cache to begin with.

Any suggestions are appreciated.

Thanks!

Dustin

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

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



More information about the jboss-user mailing list