4 Replies Latest reply on Feb 4, 2013 9:27 AM by Surendra Ind

    ClassLoader issues while typecasting message object of MDB in HornetQ 2.2.5 Final

    Surendra Ind Newbie

      When i tried to typecast the message object of MDB, i am getting the JMSException as classloader issues.

      How can i fix this issue?

      I am using  Jboss6-M5.

       

      I tried by commenting WarClassLoaderDeployer in war-deployers-jboss-beans.xml

       

      <!--   <bean name="WarClassLoaderDeployer" class="org.jboss.web.tomcat.service.deployers.WarClassLoaderDeployer">

            <property name="relativeOrder">-1</property>

            <property name="filteredPackages">javax.servlet</property>     

         </bean> -->

       

      and also with onMessage to temporarily change the TCCL.  But both cases are not working.

       

      Even migrating HornetQ from 2.1.2 to 2.2.5 Final is also not working...



      =====onMessage() of MDB=========

      public void onMessage(Message msg)

      {

           try{

                if (msg instanceof ObjectMessage){

                     System.out.println(" DEBUG >>>>> ObjectMessage Found for Delivery");

                     EmailInfo emailInfo = null;

                     emailInfo = (EmailInfo) (((ObjectMessage)msg).getObject());

                     try{

                               System.out.println(" DEBUG >>>>> Message Found for Delivery");

                               new SendEmailHelper(emailInfo).sendMail();

                               System.out.println(" DEBUG >>>>> Message Sent using HornetQ");

                      }

                     catch(Exception e){

                                e.printStackTrace();

                      }

                }

           }

           catch (JMSException je)

           {

                System.out.println(" DEBUG >>>>> JMSException>>>");

                je.printStackTrace();

                System.out.println(je.getMessage());

           }

      }

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

      ====server log======================

      10:03:35,343 INFO  [STDOUT]  DEBUG >>>>> ObjectMessage Found for Delivery

      10:03:35,375 INFO  [STDOUT]  DEBUG >>>>> JMSException>>>

      10:03:35,375 ERROR [STDERR] javax.jms.JMSException: com.mysedan.lookup.MsLicensee.MsLicensee

      10:03:35,375 ERROR [STDERR]     at java.net.URLClassLoader$1.run(URLClassLoader.java:200)

      10:03:35,390 ERROR [STDERR]     at java.security.AccessController.doPrivileged(Native Method)

      10:03:35,390 ERROR [STDERR]     at java.net.URLClassLoader.findClass(URLClassLoader.java:188)

      10:03:35,390 ERROR [STDERR]     at java.lang.ClassLoader.loadClass(ClassLoader.java:306)

      10:03:35,390 ERROR [STDERR]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276)

      10:03:35,406 ERROR [STDERR]     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

      10:03:35,406 ERROR [STDERR]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

      10:03:35,406 ERROR [STDERR]     at java.lang.Class.forName0(Native Method)

      10:03:35,406 ERROR [STDERR]     at java.lang.Class.forName(Class.java:247)

      10:03:35,406 ERROR [STDERR]     at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:284)

      10:03:35,421 ERROR [STDERR]     at org.jboss.classloader.spi.base.BaseClassLoaderDomain.loadClass(BaseClassLoaderDomain.java:1152)

      10:03:35,421 ERROR [STDERR]     at org.jboss.classloader.spi.base.BaseClassLoader.loadClassFromDomain(BaseClassLoader.java:886)

      10:03:35,421 ERROR [STDERR]     at org.jboss.classloader.spi.base.BaseClassLoader.doLoadClass(BaseClassLoader.java:505)

      10:03:35,421 ERROR [STDERR]     at org.jboss.classloader.spi.base.BaseClassLoader.loadClass(BaseClassLoader.java:450)

      10:03:35,437 ERROR [STDERR]     at java.lang.ClassLoader.loadClass(ClassLoader.java:251)

      10:03:35,437 ERROR [STDERR]     at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)

      10:03:35,437 ERROR [STDERR]     at java.lang.Class.forName0(Native Method)

      10:03:35,437 ERROR [STDERR]     at java.lang.Class.forName(Class.java:247)

      10:03:35,437 ERROR [STDERR]     at java.io.ObjectInputStream.resolveProxyClass(ObjectInputStream.java:676)

      10:03:35,453 ERROR [STDERR]     at java.io.ObjectInputStream.readProxyDesc(ObjectInputStream.java:1531)

      10:03:35,453 ERROR [STDERR]     at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1493)

      10:03:35,484 ERROR [STDERR]     at java.util.ArrayList.readObject(ArrayList.java:593)

      10:03:35,531 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      10:03:35,531 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      10:03:35,531 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      10:03:35,531 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

      10:03:35,531 ERROR [STDERR]     at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:974)

      10:03:35,546 ERROR [STDERR]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1846)

      10:03:35,546 ERROR [STDERR]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)

      10:03:35,546 ERROR [STDERR]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

      10:03:35,546 ERROR [STDERR]     at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1945)

      10:03:35,562 ERROR [STDERR]     at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1869)

      10:03:35,562 ERROR [STDERR]     at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1753)

      10:03:35,562 ERROR [STDERR]     at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)

      10:03:35,562 ERROR [STDERR]     at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

      10:03:35,578 ERROR [STDERR]     at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)

      10:03:35,578 ERROR [STDERR]     at com.mysedan.service.mail2.EmailMessageBean.onMessage(EmailMessageBean.java:90)

      10:03:35,578 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

      10:03:35,578 ERROR [STDERR]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

      10:03:35,593 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

      10:03:35,593 ERROR [STDERR]     at org.jboss.invocation.Invocation.performCall(Invocation.java:386)

      10:03:35,593 ERROR [STDERR]     at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:518)

      10:03:35,609 ERROR [STDERR]     at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:156)

      10:03:35,609 ERROR [STDERR]     at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:115)

      10:03:35,609 ERROR [STDERR]     at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)

      10:03:35,609 ERROR [STDERR]     at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)

      10:03:35,625 ERROR [STDERR]     at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)

      10:03:35,625 ERROR [STDERR]     at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)

      10:03:35,656 ERROR [STDERR]     at org.jboss.ejb.plugins.RunAsSecurityInterceptor.process(RunAsSecurityInterceptor.java:133)

      10:03:35,656 ERROR [STDERR]     at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:103)

      10:03:35,671 ERROR [STDERR]     at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)

      10:03:35,671 ERROR [STDERR]     at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:138)

      10:03:35,671 ERROR [STDERR]     at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:420)

      10:03:35,671 ERROR [STDERR]     at org.jboss.ejb.Container.invoke(Container.java:1072)

      10:03:35,687 ERROR [STDERR]     at sun.reflect.GeneratedMethodAccessor329.invoke(Unknown Source)

      10:03:35,687 ERROR [STDERR]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      10:03:35,687 ERROR [STDERR]     at java.lang.reflect.Method.invoke(Method.java:597)

      10:03:35,703 ERROR [STDERR]     at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:157)

      10:03:35,703 ERROR [STDERR]     at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)

      10:03:35,703 ERROR [STDERR]     at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)

      10:03:35,703 ERROR [STDERR]     at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:271)

      10:03:35,718 ERROR [STDERR]     at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:670)

      10:03:35,718 ERROR [STDERR]     at org.jboss.invocation.local.LocalInvoker$MBeanServerAction.invoke(LocalInvoker.java:169)

      10:03:35,718 ERROR [STDERR]     at org.jboss.invocation.local.LocalInvoker.invoke(LocalInvoker.java:118)

      10:03:35,734 ERROR [STDERR]     at org.jboss.invocation.InvokerInterceptor.invokeLocal(InvokerInterceptor.java:209)

      10:03:35,750 ERROR [STDERR]     at org.jboss.invocation.InvokerInterceptor.invoke(InvokerInterceptor.java:195)

      10:03:35,750 ERROR [STDERR]     at org.jboss.proxy.TransactionInterceptor.invoke(TransactionInterceptor.java:61)

      10:03:35,750 ERROR [STDERR]     at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.delivery(MessageEndpointInterceptor.java:249)

      10:03:35,781 ERROR [STDERR]     at org.jboss.ejb.plugins.inflow.MessageEndpointInterceptor.invoke(MessageEndpointInterceptor.java:128)

      10:03:35,781 ERROR [STDERR]     at org.jboss.proxy.ClientMethodInterceptor.invoke(ClientMethodInterceptor.java:74)

      10:03:35,781 ERROR [STDERR]     at org.jboss.proxy.ClientContainer.invoke(ClientContainer.java:101)

      10:03:35,781 ERROR [STDERR]     at $Proxy219.onMessage(Unknown Source)

      10:03:35,796 ERROR [STDERR]     at org.hornetq.ra.inflow.HornetQMessageHandler.onMessage(HornetQMessageHandler.java:278)

      10:03:35,812 ERROR [STDERR]     at org.hornetq.core.client.impl.ClientConsumerImpl.callOnMessage(ClientConsumerImpl.java:866)

      10:03:35,859 ERROR [STDERR]     at org.hornetq.core.client.impl.ClientConsumerImpl.access$100(ClientConsumerImpl.java:44)

      10:03:35,859 ERROR [STDERR]     at org.hornetq.core.client.impl.ClientConsumerImpl$Runner.run(ClientConsumerImpl.java:983)

      10:03:35,875 ERROR [STDERR]     at org.hornetq.utils.OrderedExecutorFactory$OrderedExecutor$1.run(OrderedExecutorFactory.java:100)

      10:03:35,875 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)

      10:03:35,875 ERROR [STDERR]     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)

      10:03:35,875 ERROR [STDERR]     at java.lang.Thread.run(Thread.java:619)

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