8 Replies Latest reply on Sep 23, 2011 9:03 AM by jaikiran

    JMS errors

    ffrizzo

      Hello Guys.

       

      I'm experiencing some problems with JMS in JBoss AS 7.

      I created the topic I need but I'm getting the following exception.

       

       

      09:00:50,379 WARN  [org.hornetq.jms.client.JMSMessageListenerWrapper] (Thread-1 (group:HornetQ-client-global-threads-829632420)) Unhandled exception thrown from onMessage: java.lang.RuntimeException: JMS Error
          at org.granite.gravity.adapters.JMSServiceAdapter$JMSClient$JMSConsumer.onMessage(JMSServiceAdapter.java:464)
          at org.hornetq.jms.client.JMSMessageListenerWrapper.onMessage(JMSMessageListenerWrapper.java:91) [hornetq-jms-2.2.7.Final.jar:]
          at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866) [hornetq-core-2.2.7.Final.jar:]
          at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44) [hornetq-core-2.2.7.Final.jar:]
          at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983) [hornetq-core-2.2.7.Final.jar:]
          at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100) [hornetq-core-2.2.7.Final.jar:]
          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:680) [:1.6.0_26]
      Caused by: javax.jms.JMSException: br.com.optimuslabs.entity.local.DadosContabilidade from [Module "org.hornetq:main" from local module loader @464c4975 (roots: /Applications/jboss-as-7.0.1.Final/modules)]
          at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:358)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:330)
          at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:307)
          at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:101)
          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:71) [hornetq-core-2.2.7.Final.jar:]
          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.readArray(ObjectInputStream.java:1666) [:1.6.0_26]
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322) [:1.6.0_26]
          at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666) [:1.6.0_26]
          at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322) [: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) [hornetq-jms-2.2.7.Final.jar:]
          at org.granite.gravity.adapters.JMSServiceAdapter$JMSClient$JMSConsumer.onMessage(JMSServiceAdapter.java:401)
          ... 8 more
      
      

       

       

      Creation of Topics

                   

      <jms-topic name="tideTopic">
           <entry name="topic/tideTopic"/>
      </jms-topic>
      <jms-topic name="optimusTopic">
           <entry name="topic/optimusTopic"/>
      </jms-topic>
      

       

       

      Thanks.

        • 1. Re: JMS errors
          jaikiran
          • 2. Re: JMS errors
            ffrizzo

            Sorry.

            My English is a little bad.

             

            This is a bug even then.

            And we have no prediction to correct the version of JBoss AS 7.0.x?


            Thanks

             

             


            • 3. Re: JMS errors
              jaikiran

              Yes, it's still a bug and hasn't yet been fixed in AS7.

              • 4. Re: JMS errors
                ffrizzo

                Can you tell me if you have any workaround for this problem?

                 

                Thanks.

                • 5. Re: JMS errors
                  ffrizzo

                  Ho Guys.

                   

                  Does anyone know if has any interim solution to the problem?

                   

                  Thanks.

                  • 6. Re: JMS errors
                    wolfc

                    org.granite.gravity.adapters.JMSServiceAdapter$JMSClient$JMSConsumer.onMessage should set the thread context class loader before executing getObject on the message.

                    • 7. Re: JMS errors
                      ffrizzo

                      Sorry,

                       

                      I did not understand what you meant.

                      Could you give an example.

                       

                      Thanks.

                      • 8. Re: JMS errors
                        jaikiran

                        In your org.granite.gravity.adapters.JMSServiceAdapter$JMSClient$JMSConsumer.onMessage method you should be doing something like this:

                        onMessage(Message message) {
                            ...
                            if (message instanceof ObjectMessage) {
                                final ObjectMessage objectMessage = (ObjectMessage) message;
                                // set the correct tccl
                                final ClassLoader old = Thread.currentThread().getContextClassLoader();
                                try {
                                    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
                                    // now get the underlying object
                                    objectMessage.getObject();
                                } finally {
                                    //reset back to the previous classloader
                                    Thread.currentThread().setContextClassLoader(old);
                                }
                        ...
                        }