3 Replies Latest reply on Aug 14, 2006 10:21 AM by clebert.suconic

    Mustang Serialization problems.

    thammoud

      Hello,

      We have encountered a serialization problem when we moved to JDK 1.6. The following EJB throws an exception (Below).

      public class TestServiceBean implements TestService {
      @TransactionAttribute(TransactionAttributeType.REQUIRED)
      public Format getFormat() {
      return DateFormat.getDateInstance(DateFormat.SHORT);
      }
      }

      The code works perfectly in 1.5. We tried the latest nightly build of Mustang to no avail. Peforming a deep clone to the same object locally works fine thus leading us to believe that the interaction with JBOSS is what is causing this problem. We are using 4.0.4 JA on linux. Thanks for any info.

      Caused by: java.rmi.MarshalException: Failed to communicate. Problem during marshalling/unmarshalling; nested exception is:
      java.io.StreamCorruptedException: invalid type code: 00
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:306)
      at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
      at org.jboss.remoting.Client.invoke(Client.java:525)
      at org.jboss.remoting.Client.invoke(Client.java:488)
      at org.jboss.aspects.remoting.InvokeRemoteInterceptor.invoke(InvokeRemoteInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.tx.ClientTxPropagationInterceptor.invoke(ClientTxPropagationInterceptor.java:61)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.aspects.security.SecurityClientInterceptor.invoke(SecurityClientInterceptor.java:55)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:65)
      at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:98)
      at org.jboss.ejb3.stateless.StatelessRemoteProxy.invoke(StatelessRemoteProxy.java:102)
      ... 2 more
      Caused by: java.io.StreamCorruptedException: invalid type code: 00
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1356)
      at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1642)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
      at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:480)
      at java.util.Calendar.readObject(Calendar.java:2609)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.aop.joinpoint.InvocationResponse.readExternal(InvocationResponse.java:107)
      at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1792)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1751)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)
      at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)
      at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)
      at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
      at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
      at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128)
      at org.jboss.remoting.marshal.serializable.SerializableUnMarshaller.read(SerializableUnMarshaller.java:66)
      at org.jboss.remoting.transport.socket.SocketClientInvoker.transport(SocketClientInvoker.java:279)

        • 1. Re: Mustang Serialization problems.
          clebert.suconic

          The stack trace you sent is JavaSerialization.

          (see.... at org.jboss.remoting.serialization.impl.java.JavaSerializationManager.receiveObject(JavaSerializationManager.java:128) )

          package names for JBossSerialization are starting with org.jboss.serial....

          You would need to configure your remoting layer to use JBossSerialization if you want to test this with JBoss Serialization.

          I know that there are a couple of issues with JBossRemoting when using Mustang with regular Java Serialization. Tom Elrod (Project lead for JBoss Remoting) is working on it. Something about some change with ClassLoading operations on Mustang:

          http://cruisecontrol.jboss.com/cc/artifacts/jboss-remoting-testsuite-1.6/20060811040223/results/index.html

          • 2. Re: Mustang Serialization problems.
            thammoud

            Thanks for the quick reply. I am really confused as to why it works under 1.5 and simply fails under 1.6. I did notice that it is NOT using Jboss serialization but figured that you will be the quickest to help :)

            >>You would need to configure your remoting layer to use JBossSerialization >>if you want to test this with JBoss Serialization.

            For the life of me, I can not find the docs to do this. Any pointers will be greatly appreciated.

            • 3. Re: Mustang Serialization problems.
              clebert.suconic

              This has to do the way JBossRemoting is solving classLoader operations.

              I believe JBossRemoting is aways doing loader.loadClass, and on JVM 1.6 it's supposed to aways do a Class.forName(..,...,classLoader).


              So.. it is some inconsistent change documented on compatibility issues on the JVM 1.6. We will have to change some code to work on JVM 1.6.


              As for the serialization type... on UnifiedInvoker you can add the parameter type to serialization
              parameter type="serialization" value="jboss"


              Take a look on Remoting documentation for the exact parameter name (I have such a bad memory :-)... and look for your UnifiedInvoker configuration. For EJB3 I believe is under ejb3.deployer directory. (If it wasn't changed recenlty)


              If you can't find I can do a quick research for you. Let me know on that case.