7 Replies Latest reply on May 25, 2006 3:23 PM by Clebert Suconic

    ClassNotFoundException when deserializing an array type that

    Matthew Smith Newbie

      I'm attempting to use JBoss serialization for some work I'm doing right now to record and playback method executions. This means I record all the input parms, and the return values. For the most part JBoss Serialization has been a working drop-in replacement for Java serialization (great job for a 1.0 release!). However, I'm now encountering a peculiar bug which I'm hoping you'll be able to help me with. Here it is.

      This bug happens when I start a JVM, serialize the an object containing an Array, stop that JVM, start a new JVM, and try to deserialize the object. I get a ClassNotFound exception. I've narrowed it down to a specific line of code (annotated below with a comment) which causes the error, and it ONLY happens the serial/deserial are executed in independent VM's. This makes me think there is (1) JBoss serialization internal state (cache?) that is affecting the behavior and (2) possibly a bug serializing arrays specified a certain way. I've checked out the latest code from jboss cvs and built a current jboss-serialization.jar to make sure this isn't a bug that's already been fixed.

      Here's the test code I'm using. You'll have to manually run some of the test methods in a specific order (and in seperate vm's) in order to see the bug manifest. It's documented in a comment.

      Notice the only difference between what can be successfully serialized and deserialized in seperate VM's is the following line:

      IA as[] = new IA[] { a }; //works

      vs.

      A as[] = new A[] { a }; //breaks it

      Cleburt, I'm e-mailing you the full test case zip file so you can attach it to a JIRA issue if need be. I don't see an attach function in this forum software.