Getting ClassCastException when calling another EJB remote interface within the same JVM in JBoss EAP 5.1.2 / EAP 5.2.0 with Java 7

Solution Verified - Updated -

Issue

  • Unable to deserialize objects when using JDK7, We have got problems when we try to deserialize objects when we use JDK7 with JBoss EAP 5.2. We found this bug https://issues.jboss.org/browse/JBSER-128 , is there a fix for it?

  • After applying Java 7 patch on JBoss EAP 5.1.2, we ran into issues with calling another EJB remote interface within the same JVM.

WorkerThread#0[127.0.0.1:40702]) Caused by: org.jboss.serial.exception.SerializationException: Excepted to be int
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readInt(DataContainer.java:1050)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:333)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:290)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:258)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:847)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.readSlotWithFields(RegularObjectPersister.java:376)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.defaultRead(RegularObjectPersister.java:290)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.persister.RegularObjectPersister.readData(RegularObjectPersister.java:258)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.readObjectDescriptionFromStreaming(ObjectDescriptorFactory.java:412)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.ObjectDescriptorFactory.objectFromDescription(ObjectDescriptorFactory.java:82)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readObject(DataContainer.java:847)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.io.MarshalledObjectForLocalCalls.get(MarshalledObjectForLocalCalls.java:60)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.ejb3.remoting.IsLocalInterceptor.marshallOrPass(IsLocalInterceptor.java:117)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.ejb3.remoting.IsLocalInterceptor.invokeLocal(IsLocalInterceptor.java:91)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.ejb3.remoting.IsLocalInterceptor.invoke(IsLocalInterceptor.java:75)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:102)
2013-03-25 16:26:08,516 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.aspects.remoting.PojiProxy.invoke(PojiProxy.java:62)
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at $Proxy119.invoke(Unknown Source)
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.ejb3.proxy.impl.handler.session.SessionProxyInvocationHandlerBase.invoke(SessionProxyInvocationHandlerBase.java:188)
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    ... 61 more
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702]) Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to org.jboss.serial.finalcontainers.IntegerContainer
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    at org.jboss.serial.objectmetamodel.DataContainer$DataContainerInput.readInt(DataContainer.java:1046)
2013-03-25 16:26:08,517 ERROR [STDERR] (WorkerThread#0[127.0.0.1:40702])    ... 81 more

Environment

  • JBoss Enterprise Application Platform (EAP)
    • 5.2.0
    • 5.1.2
  • Oracle JDK 7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In