EJB Transfer objects referencing java.rmi.* classes fails with UnmarshalException in JBoss EAP 7.2

Solution Verified - Updated -

Issue

  • EJB Transfer objects referencing java.rmi.* classes fails with UnmarshalException in JBoss EAP 7.2 , this error is shown on the client side:
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is: 
    java.net.SocketException: Socket closed
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:236)
    at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:161)
    at integrationframework.extension.business.RemoteURLImpl_Stub.getRelativePath(RemoteURLImpl_Stub.java:57)
    at datatransferaccess.bcsinadapter.business.BcsInExecutor.download(BcsInExecutor.java:92)
    ... 81 more
Caused by: java.net.SocketException: Socket closed
    at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:118)
    at java.net.SocketOutputStream.write(SocketOutputStream.java:155)
    at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:82)
    at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:140)
    at java.io.ObjectOutputStream$BlockDataOutputStream.flush(ObjectOutputStream.java:1823)
    at java.io.ObjectOutputStream.flush(ObjectOutputStream.java:719)
    at sun.rmi.transport.StreamRemoteCall.releaseOutputStream(StreamRemoteCall.java:115)
    at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
    ... 84 more

When debugging the server side, it is found there is a ClassNotFoundException :

(default task-2) java.lang.ClassNotFoundException: java.rmi.dgc.Lease from [Module "org.wildfly.extension.io" version 6.0.12.Final-redhat-00001 from local module loader @6a024a67 (finder: local module finder @7921b0a2 (roots: /tmp/jboss-eap-7.2/modules,/tmp/jboss-eap-7.2/modules/system/layers/base))] (no security manager: RMI class loader disabled)
(default task-2) java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:97)
(default task-2) sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:396)
(default task-2) sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:186)
(default task-2) java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:637)
(default task-2) java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:264)
(default task-2) sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:219)
(default task-2) java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1868)
(default task-2) java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1751)
(default task-2) java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:2042)
(default task-2) java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1573)
(default task-2) java.io.ObjectInputStream.readObject(ObjectInputStream.java:431)
(default task-2) sun.rmi.transport.DGCImpl_Stub.dirty(DGCImpl_Stub.java:125)
(default task-2) sun.rmi.transport.DGCClient$EndpointEntry.makeDirtyCall(DGCClient.java:382)
(default task-2) sun.rmi.transport.DGCClient$EndpointEntry.registerRefs(DGCClient.java:324)
(default task-2) sun.rmi.transport.DGCClient.registerRefs(DGCClient.java:160)
(default task-2) sun.rmi.transport.LiveRef.read(LiveRef.java:312)
(default task-2) sun.rmi.server.UnicastRef.readExternal(UnicastRef.java:489)
(default task-2) java.rmi.server.RemoteObject.readObject(RemoteObject.java:455)
(default task-2) sun.reflect.NativeMethodAccessorImpl.invoke0(NativeMethodAccessorImpl.java:-2)
(default task-2) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
(default task-2) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
(default task-2) java.lang.reflect.Method.invoke(Method.java:498)
(default task-2) org.jboss.marshalling.reflect.JDKSpecific$SerMethods.callReadObject(JDKSpecific.java:179)
(default task-2) org.jboss.marshalling.reflect.SerializableClass.callReadObject(SerializableClass.java:212)
(default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1746)
(default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1715)
(default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doInitSerializable(RiverUnmarshaller.java:1715)
 (default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1395)
 (default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)
 (default task-2) org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:205)
 (default task-2) org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:41)
 (default task-2) org.jboss.ejb.protocol.remote.EJBServerChannel$RemotingInvocationRequest.getRequestContent(EJBServerChannel.java:813)
 (default task-2) org.jboss.as.ejb3.remote.AssociationImpl.receiveInvocationRequest(AssociationImpl.java:130)
 (default task-2) org.jboss.ejb.protocol.remote.EJBServerChannel$ReceiverImpl.handleInvocationRequest(EJBServerChannel.java:451)
 (default task-2) org.jboss.ejb.protocol.remote.EJBServerChannel$ReceiverImpl.handleMessage(EJBServerChannel.java:189)
 (default task-2) org.jboss.remoting3.remote.RemoteConnectionChannel.lambda$handleMessageData$3(RemoteConnectionChannel.java:430)
 (default task-2) org.jboss.remoting3.EndpointImpl$TrackingExecutor.lambda$execute$0(EndpointImpl.java:949)
 (default task-2) org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
 (default task-2) org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
 (default task-2) org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
 (default task-2) org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
 (default task-2) java.lang.Thread.run(Thread.java:748)

Environment

Red Hat JBoss Enterprise Application Platform (EAP) 7.2

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