-
1. Re: Serialization problem using JDBC cache loader and MySQL
brian.stansberry Oct 13, 2009 9:46 AM (in response to drcallaway)Are you saying you made serialVersionUID a mutable field and are setting it to one on some instances of the class? That won't work; the java io classes (not JBoss) compare the value read from the stream to the value of the Class object.
-
2. Re: Serialization problem using JDBC cache loader and MySQL
drcallaway Oct 13, 2009 1:28 PM (in response to drcallaway)No, it is not mutable. The serialized classes contain this code generated by the JAXB compiler:
private final static long serialVersionUID = 1L;
The classes seem to be getting stored with this UID but not extracted that way. -
3. Re: Serialization problem using JDBC cache loader and MySQL
brian.stansberry Oct 13, 2009 1:35 PM (in response to drcallaway)I suspect you have different versions of the class on the classpath.
Caused by: java.io.InvalidClassException: com.company.generated.MyNode; local class incompatible: stream classdesc serialVersionUID = 1, local class serialVersionUID = -7258818124315218931
JBoss is not generating that local class serialVersionUID = -7258818124315218931; that comes from the JRE, which must be seeing a different version of the class. -
4. Re: Serialization problem using JDBC cache loader and MySQL
drcallaway Oct 13, 2009 4:59 PM (in response to drcallaway)Yep. You nailed it. I discovered that I had an old version of the WAR file still in JBoss's deploy directory. Somehow JBoss was inserting the newer file into JBC but using the older class when pulling it out. I removed the old WAR file and everything seems to be working fine. Thanks!