7 Replies Latest reply on Aug 25, 2011 12:54 PM by Oliver Vesper

    JMSException while running ObjectMessage.getObject

    maximep Newbie

      Hi everyone,

       

      I get this error when trying to receive an ObjectMessage with a MessageListener :

       

      ===========================================================

      16:30:43,998 ERROR [fr.somestuff.observer.ssemtrack.SSEMListener]

      fr.somestuff.observer.ssemtrack.SSEMListener@b76c7a: javax.jms.JMSException: fr.sopra.sms.utilities.msg.SSEMTrackMessage

              at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [:1.6.0_26]

              at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_26]

              at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [:1.6.0_26]

              at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [:1.6.0_26]

              at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [:1.6.0_26]

              at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_26]

              at java.lang.Class.forName0(Native Method) [:1.6.0_26]

              at java.lang.Class.forName(Class.java:247) [:1.6.0_26]

              at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284) [jboss-classloader.jar:2.2.0.GA]

              at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152) [jboss-classloader.jar:2.2.0.GA]

              at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.0.GA]

              at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.0.GA]

              at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.0.GA]

              at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_26]

              at java.lang.Class.forName0(Native Method) [:1.6.0_26]

              at java.lang.Class.forName(Class.java:247) [:1.6.0_26]

              at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603) [:1.6.0_26]

              at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69) [:6.0.0.Final]

              at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574) [:1.6.0_26]

              at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) [:1.6.0_26]

              at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) [:1.6.0_26]

              at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) [:1.6.0_26]

              at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) [:1.6.0_26]

              at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158) [:6.0.0.Final]

              at fr.somestuff.observer.ssemtrack.SSEMListener.onMessage(SSEMListener.java:34)

              at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91) [:6.0.0.Final]

              at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:822) [:6.0.0.Final]

              at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:46) [:6.0.0.Final]

              at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:940) [:6.0.0.Final]

              at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.0.0.Final]

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

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

              at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

       

      ==============================================================

       

      I have set the package containing SSEMTrackMessage as a dependance for this project in Maven, and this configuration worked well when consuming messages from a local Queue. Here I am trying to consume messages from a remote Topic.

       

      Any idea? Thanks!

        • 1. Re: JMSException while running ObjectMessage.getObject
          maximep Newbie

          I got this fixed thanks to the #14 message of this thread : http://community.jboss.org/thread/162333.

          However, this is not as classy as I expected to do it!

          • 2. Re: JMSException while running ObjectMessage.getObject
            Clebert Suconic Master

            What version?

             

             

            AFAIK this was fixed

            • 3. Re: JMSException while running ObjectMessage.getObject
              maximep Newbie

              The one which is embedded with JBoss 6.0.0 Final (2.1.2 I think).

              • 5. Re: JMSException while running ObjectMessage.getObject
                Oliver Vesper Newbie

                I'm facing the same issue running on JBoss AS 6.1 which uses the following HornetQ version:

                 

                HornetQ Server version 2.2.5.Final (HQ_2_2_5_FINAL_AS7, 121)

                 

                 

                Here is my stacktrace:

                2011-08-25 15:01:00,736 DEBUG [test.Foo(Thread-9954 (group:HornetQ-client-global-threads-911139709)) received jms message: HornetQMessage[ID:48213509-cf1a-11e0-b288-005056a07579]:NON-PERSISTENT

                2011-08-25 15:01:00,757 ERROR [test.Foo] (Thread-9954 (group:HornetQ-client-global-threads-911139709)) : javax.jms.JMSException: test.TestDTO

                        at java.net.URLClassLoader$1.run(URLClassLoader.java:202) [:1.6.0_26]

                        at java.security.AccessController.doPrivileged(Native Method) [:1.6.0_26]

                        at java.net.URLClassLoader.findClass(URLClassLoader.java:190) [:1.6.0_26]

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:306) [:1.6.0_26]

                        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) [:1.6.0_26]

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_26]

                        at java.lang.Class.forName0(Native Method) [:1.6.0_26]

                        at java.lang.Class.forName(Class.java:247) [:1.6.0_26]

                        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:304) [jboss-classloader.jar:2.2.1.GA]

                        at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1172) [jboss-classloader.jar:2.2.1.GA]

                        at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886) [jboss-classloader.jar:2.2.1.GA]

                        at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505) [jboss-classloader.jar:2.2.1.GA]

                        at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450) [jboss-classloader.jar:2.2.1.GA]

                        at java.lang.ClassLoader.loadClass(ClassLoader.java:247) [:1.6.0_26]

                        at java.lang.Class.forName0(Native Method) [:1.6.0_26]

                        at java.lang.Class.forName(Class.java:247) [:1.6.0_26]

                        at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:603) [:1.6.0_26]

                        at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69) [:6.1.0.Final]

                        at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574) [:1.6.0_26]

                        at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495) [:1.6.0_26]

                        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1731) [:1.6.0_26]

                        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328) [:1.6.0_26]

                        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350) [:1.6.0_26]

                        at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158) [:6.1.0.Final]

                        at test.Foo.onMessage(Foo.java:109)

                        at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91) [:6.1.0.Final]

                        at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866) [:6.1.0.Final]

                        at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44) [:6.1.0.Final]

                        at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983) [:6.1.0.Final]

                        at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [:6.1.0.Final]

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

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

                        at java.lang.Thread.run(Thread.java:662) [:1.6.0_26]

                • 6. Re: JMSException while running ObjectMessage.getObject
                  Clebert Suconic Master

                  The exception is just saying it couldn't find test.TestDTO at your classLoader. I have no indication that class isolation is wrong at 2.2.5.

                   

                  You still have to supply the class on a valid jar at the client app's classloader.

                  • 7. Re: JMSException while running ObjectMessage.getObject
                    Oliver Vesper Newbie

                    Here is my structure (stripped down to the relevant parts):

                    • EAR
                      • JAR #1
                        • DTO-class
                      • JAR #2
                        • Some class which produces JMS messages
                      • WAR
                        • JSF-Bean implementing MessageListener and doing all the JMS-stuff (like injection of ConnectionFactory+Topic, opening connection, creating consumer etc.)

                     

                    The JSF-Bean is able to load the DTO-class but not within the onMessage-method. Using that workaround to exchange the context-classloader makes it work.

                     

                    Am I supposed to place the DTO-class somewhere else?

                     

                    Thanks for your help.

                     

                    -Oliver