3 Replies Latest reply on Apr 4, 2014 6:21 AM by Sumit Anil Bhawsar

    ClassLoader issue when using JBoss remoting in AS 7.1.1

    Victor Garcia Newbie

      Hi,

       

      I am runing a junit test using jboss-remoting to test a stateless session bean running on JBoss 7.1.1, and a get this error:

       

      10:51:58,765 ERROR [org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver] (Remoting "bahrain" task-3) Exception on channel Channel ID 4c947d59 (inbound) of Remoting connection 00137b1e to /127.0.0.1:2093 from message org.jboss.remoting3.remote.InboundMessage$3@d206f9: java.io.InvalidClassException: com.aplica.plus.tarjeta.negocio.modelo.TarjetaInteligente; Class does not extend stream superclass

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:909)

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1314)

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

          at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

          at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]

          at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.processMessage(MethodInvocationMessageHandler.java:156)

          at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.handleMessage(VersionOneProtocolChannelReceiver.java:170)

          at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_18]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_18]

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_18]

      Caused by: an exception which occurred:

          in object of type java.lang.Class

       

      this  the method i am invoking:

       

      public DefinicionBase findDefinicionBasePropiedades(Class<? extends ObjetoFidelizacion> claseObjeto);

       

      and the test is invoking the method with the class TarjetaInteligente as the parameter, which extends ObjetoFidelizacion.

       

       

      I also have another test who sends an object to the server which is then used a a parameter in a jpa query, and in this case the server throws the following exception:

       

      Caused by: java.lang.IllegalArgumentException: Parameter value [com.aplicaltda.plus.establecimiento.modelo.Establecimiento@32] did not match expected type [com.aplicaltda.plus.establecimiento.modelo.Establecimiento]

          at org.hibernate.ejb.AbstractQueryImpl.validateParameterBinding(AbstractQueryImpl.java:375) [hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final]

          at org.hibernate.ejb.AbstractQueryImpl.registerParameterBinding(AbstractQueryImpl.java:348) [hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final]

          at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:375) [hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final]

          at org.hibernate.ejb.QueryImpl.setParameter(QueryImpl.java:72) [hibernate-entitymanager-4.1.4.Final.jar:4.1.4.Final]

          at com.aplicaltda.common.dao.QueryUtil.getQuery(QueryUtil.java:49) [aplicaltda-common-1.10-SNAPSHOT.jar:]

          at com.aplica.validation.dao.UniqueDAOImpl.existsObject(UniqueDAOImpl.java:58) [aplica-validation-ejb-1.3-SNAPSHOT.jar:]

          at sun.reflect.GeneratedMethodAccessor213.invoke(Unknown Source) [:1.6.0_18]

          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [rt.jar:1.6.0_18]

          at java.lang.reflect.Method.invoke(Method.java:597) [rt.jar:1.6.0_18]

       

       

      Could all this be a classloader issue? maybe jboss remoting use a diferent classloader that the classloader use by the application. If it is so, is there a way to make jboss remoting use the same classloader that my application, or visceversa?

        • 1. Re: ClassLoader issue when using JBoss remoting in AS 7.1.1
          Loc Tran Newbie

          Hi Garcia,

           

          I got the same problem!

           

          Here is messge from server:

           

          11:38:23,040 ERROR [org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver] (Remoting "tranloc" task-4) Exception on channel Channel ID 3c153634 (inbound) of Remoting connection 66673ecf to /127.0.0.1:59357 from message org.jboss.remoting3.remote.InboundMessage$3@1d3ca9d7: java.io.InvalidClassException: test.manager.model.User; Class does not extend stream superclass

                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:909)

                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1204)

                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

                    at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

                    at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]

                    at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.processMessage(MethodInvocationMessageHandler.java:156)

                    at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.handleMessage(VersionOneProtocolChannelReceiver.java:170)

                    at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_33]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_33]

                    at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_33]

           

          And this is the message from test client:

           

          Dec 17, 2012 12:02:34 PM org.xnio.Xnio <clinit>

          INFO: XNIO Version 3.0.3.GA

          Dec 17, 2012 12:02:35 PM org.xnio.nio.NioXnio <clinit>

          INFO: XNIO NIO Implementation Version 3.0.3.GA

          Dec 17, 2012 12:02:35 PM org.jboss.remoting3.EndpointImpl <clinit>

          INFO: JBoss Remoting version 3.2.3.GA

          Dec 17, 2012 12:02:35 PM org.jboss.ejb.client.remoting.VersionReceiver handleMessage

          INFO: Received server version 1 and marshalling strategies [river]

          Dec 17, 2012 12:02:35 PM org.jboss.ejb.client.remoting.RemotingConnectionEJBReceiver associate

          INFO: Successful version handshake completed for receiver context EJBReceiverContext{clientContext=org.jboss.ejb.client.EJBClientContext@5e3ca754, receiver=Remoting connection EJB receiver [connection=Remoting connection <265a2eaa>,channel=jboss.ejb,nodename=tranloc]} on channel Channel ID c17b78c1 (outbound) of Remoting connection 56f449b8 to localhost/127.0.0.1:4447

          Dec 17, 2012 12:02:35 PM org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleMessage

          WARN: Unsupported message received with header 0xffffffff

          Dec 17, 2012 12:02:41 PM org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver handleEnd

          INFO: Channel Channel ID c17b78c1 (outbound) of Remoting connection 56f449b8 to localhost/127.0.0.1:4447 can no longer process messages

           

           

          java.lang.reflect.UndeclaredThrowableException

                    at $Proxy4.createUser(Unknown Source)

                    at test.TestCreateUser.test(TestCreateUser.java:76)

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

                    at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)

                    at org.junit.runner.JUnitCore.run(JUnitCore.java:157)

                    at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:63)

          Caused by: java.io.IOException: Channel Channel ID c17b78c1 (outbound) of Remoting connection 56f449b8 to localhost/127.0.0.1:4447 has been closed

                    at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:110)

                    at org.jboss.ejb.client.remoting.ChannelAssociation$1.handleClose(ChannelAssociation.java:102)

                    at org.jboss.remoting3.spi.SpiUtils.safeHandleClose(SpiUtils.java:54)

                    at org.jboss.remoting3.spi.AbstractHandleableCloseable$CloseHandlerTask.run(AbstractHandleableCloseable.java:501)

                    at org.jboss.remoting3.spi.AbstractHandleableCloseable.runCloseTask(AbstractHandleableCloseable.java:406)

                    at org.jboss.remoting3.spi.AbstractHandleableCloseable.closeComplete(AbstractHandleableCloseable.java:277)

                    at org.jboss.remoting3.remote.RemoteConnectionChannel.closeAction(RemoteConnectionChannel.java:517)

                    at org.jboss.remoting3.spi.AbstractHandleableCloseable.close(AbstractHandleableCloseable.java:153)

                    at org.jboss.ejb.client.remoting.ChannelAssociation$ResponseReceiver.handleEnd(ChannelAssociation.java:373)

                    at org.jboss.remoting3.remote.RemoteConnectionChannel$2.run(RemoteConnectionChannel.java:276)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                    at java.lang.Thread.run(Thread.java:662)

           

           

          Disconnected from the target VM, address: '127.0.0.1:60275', transport: 'socket'

           

          Please update  if you already found out how to resolve

          • 2. Re: ClassLoader issue when using JBoss remoting in AS 7.1.1
            Loc Tran Newbie

            Just a note for solutions:

             

            Current system make error:

              - module1.ear contain ejb1.jar

              - module2.ear contain ejb2.jar: jboss-deployment-structure.xml: add dependencies to module1.ear.ejb1.jar. And ejb2.jar' persistence.xml has include <class>Model1<class> of module1. Model1 is an serializable entity inherit an MappedSuperClass.

              - our test client call an ejb2''s methodtobetest(model1).

             

            The problem is deseralize object model1 at module2, so we change the interface of function to methodtobetest(String model1ObjectId). The other solution is include the model1 class to module2.ear (class or jar both is okie) but this is not the way we want.

            • 3. Re: ClassLoader issue when using JBoss remoting in AS 7.1.1
              Sumit Anil Bhawsar Newbie

              Hi Tran,

              I am also facing the same issue with JBoss 7.1.1.

              My error is

              15:10:22,136 ERROR [org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver] (Remoting "sumitb" task-1) Exception on channel Channel ID 21d3a794 (inbound) of Remoting connection 0064de79 to /127.0.0.1:54488 from message org.jboss.remoting3.remote.InboundMessage$3@28858d: java.io.InvalidClassException: com.mqa.iam.om.oro.MQAClassGroup; Class does not extend stream superclass

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:909)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:902)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:902)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:905)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:902)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadClassDescriptor(RiverUnmarshaller.java:902)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadNewObject(RiverUnmarshaller.java:1204)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:272)

                  at org.jboss.marshalling.river.RiverUnmarshaller.doReadObject(RiverUnmarshaller.java:209)

                  at org.jboss.marshalling.AbstractObjectInput.readObject(AbstractObjectInput.java:37) [jboss-marshalling-1.3.11.GA.jar:1.3.11.GA]

                  at org.jboss.as.ejb3.remote.protocol.versionone.MethodInvocationMessageHandler.processMessage(MethodInvocationMessageHandler.java:156)

                  at org.jboss.as.ejb3.remote.protocol.versionone.VersionOneProtocolChannelReceiver.handleMessage(VersionOneProtocolChannelReceiver.java:170)

                  at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:437) [jboss-remoting-3.2.3.GA.jar:3.2.3.GA]

                  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_17]

                  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_17]

                  at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_17]

               

               

               

              Please let me know if there is any solution for above issue.

               

              Thanks