3 Replies Latest reply on Jul 1, 2005 8:08 AM by Karl Koster

    serialization issue

    doofus Newbie

      When deploying my ejb3 file to jboss (4.0.1sp1 + preview 5) i get this error:

      Caused by: java.rmi.ConnectException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
       java.io.InvalidClassException: [classname]; local class incompatible: stream classdesc serialVersionUID = 1161519387367562485, local class serialVersionUID = -911112481

      [classname] is my class name.

      If i restart the server after deploying the EJB it all starts up / works perfectly.

      Any ideas? All entity classes implement serializable and i have specified serialVersionUID fileds for them all? It is a little annoying having to restart the server after deploying my EJB.

        • 1. Re: serialization issue
          Murtuza Vohra Newbie

          I have similar problem can anyone show what is the problem. On my side i cannot run the client even then i restart the application server. The error thrown is

          java.lang.RuntimeException: java.io.InvalidClassException: com.kt.inventory.entity.bean.Category; local class incompatible: stream classdesc serialVersionUID = 7532859717847406178, local class serialVersionUID = -2072288254546005124
           at org.jboss.aop.joinpoint.MethodInvocation.getArguments(MethodInvocation.java:213)
           at org.jboss.ejb3.stateless.StatelessContainer.dynamicInvoke(StatelessContainer.java:179)
           at org.jboss.aop.Dispatcher.invoke(Dispatcher.java:107)

          • 2. Re: serialization issue
            Bill Burke Master

            So, you are allocating an instance of Category on the client and passing it as an argument to the server?

            My guess is the problem is exactly what the error message is telling you, that the client's class is incompatible with the servers. Are you sure the client and server jars are the same? Check your build scripts.

            • 3. Re: serialization issue
              Karl Koster Newbie

              It has often been suggested to supply your own serialVerisionUID so versioning can be managed the developer. Do this by supplying a private static final long named serialVersionUID within the serializable classes.