5 Replies Latest reply on Feb 19, 2008 6:17 PM by peterj

    Migrating application from Websphere to Jboss

    tosaurav

      I am trying to port/migrate my WebShpere based application to JBOSS and followed thru Wiki examples - work with MQ.

      Application has 1 MDB let say childMDB which listen on Q_IN and parent of this MDB say parentMDB is an abstract class with one method to send message further.In ejb-jar.xml & jboss.xml - defined childMDB.

      Problem comes when I drop the message in queue the log reflects error with respect to Parent Class - NoClassDefFoundError-parentMDB.

      Just like wiki example(MDB) I bundle everything in jar file instead of .ear or .war file.

      Am I missing something in deployment descriptor or issue with class loader?

        • 1. Re: Migrating application from Websphere to Jboss
          peterj

          It usually helps to post the full stack trace.

          And post the contents of you jar file. Use:

          jar -tf xxx.jar

          Also, state which version of JBossAS you are using.

          • 2. Re: Migrating application from Websphere to Jboss
            tosaurav

            Here is the stack trace. I am using JBOSS-4.2.2 GA version.

            10:08:07,862 ERROR [LogInterceptor] TransactionRolledbackLocalException in metho
            d: public abstract void javax.jms.MessageListener.onMessage(javax.jms.Message),
            causedBy:
            javax.ejb.EJBException: Unexpected Error
            java.lang.NoClassDefFoundError
            at gov.uspto.ram.agency.mdb.AbstractEaiMDB.onMessage(AbstractEaiMDB.java
            :46)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
            at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(Mess
            ageDrivenContainer.java:495)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
            ke(CachedConnectionInterceptor.java:158)
            at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(Message
            DrivenInstanceInterceptor.java:116)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
            Interceptor.java:63)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:121)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
            torCMT.java:350)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
            81)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityIn
            terceptor.java:109)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
            ryFinderInterceptor.java:138)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenCont
            ainer.java:402)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
            ker.java:987)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
            essage(JMSContainerInvoker.java:1287)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
            at com.ibm.mq.jms.MQSession.run(MQSession.java:1588)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)

            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:237)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
            torCMT.java:350)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
            81)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityIn
            terceptor.java:109)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
            ryFinderInterceptor.java:138)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenCont
            ainer.java:402)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
            ker.java:987)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
            essage(JMSContainerInvoker.java:1287)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
            at com.ibm.mq.jms.MQSession.run(MQSession.java:1588)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)
            10:08:07,972 ERROR [JMSContainerInvoker] Exception in JMSCI message listener
            javax.ejb.TransactionRolledbackLocalException: Unexpected Error
            java.lang.NoClassDefFoundError
            at gov.uspto.ram.agency.mdb.AbstractEaiMDB.onMessage(AbstractEaiMDB.java
            :46)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
            at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(Mess
            ageDrivenContainer.java:495)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
            ke(CachedConnectionInterceptor.java:158)
            at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(Message
            DrivenInstanceInterceptor.java:116)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
            Interceptor.java:63)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:121)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
            torCMT.java:350)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
            81)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityIn
            terceptor.java:109)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
            ryFinderInterceptor.java:138)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenCont
            ainer.java:402)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
            ker.java:987)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
            essage(JMSContainerInvoker.java:1287)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
            at com.ibm.mq.jms.MQSession.run(MQSession.java:1588)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)

            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:262)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
            torCMT.java:350)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
            81)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityIn
            terceptor.java:109)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
            ryFinderInterceptor.java:138)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenCont
            ainer.java:402)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
            ker.java:987)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
            essage(JMSContainerInvoker.java:1287)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
            at com.ibm.mq.jms.MQSession.run(MQSession.java:1588)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.ejb.EJBException: Unexpected Error
            java.lang.NoClassDefFoundError
            at gov.uspto.ram.agency.mdb.AbstractEaiMDB.onMessage(AbstractEaiMDB.java
            :46)
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
            java:39)
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
            sorImpl.java:25)
            at java.lang.reflect.Method.invoke(Method.java:585)
            at org.jboss.invocation.Invocation.performCall(Invocation.java:359)
            at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(Mess
            ageDrivenContainer.java:495)
            at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invo
            ke(CachedConnectionInterceptor.java:158)
            at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(Message
            DrivenInstanceInterceptor.java:116)
            at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidation
            Interceptor.java:63)
            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:121)
            at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
            torCMT.java:350)
            at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
            81)
            at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityIn
            terceptor.java:109)
            at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:205)
            at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFacto
            ryFinderInterceptor.java:138)
            at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenCont
            ainer.java:402)
            at org.jboss.ejb.Container.invoke(Container.java:960)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
            ker.java:987)
            at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
            essage(JMSContainerInvoker.java:1287)
            at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
            at com.ibm.mq.jms.MQSession.run(MQSession.java:1588)
            at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:196)
            at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
            utor.java:761)
            at java.lang.Thread.run(Thread.java:595)

            at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInte
            rceptor.java:237)
            ... 14 more


            And Contents of jar file ::

            META-INF/
            META-INF/MANIFEST.MF
            gov/
            gov/uspto/
            gov/uspto/ram/
            gov/uspto/ram/agency/
            gov/uspto/ram/agency/mdb/
            META-INF/ejb-jar.xml
            META-INF/jboss.xml
            gov/uspto/ram/agency/mdb/AbstractEaiMDB.class
            gov/uspto/ram/agency/mdb/RamEaiMDBean.class

            • 3. Re: Migrating application from Websphere to Jboss
              peterj

              It found the parent class just fine. Note the first line of the stack trace:

              at gov.uspto.ram.agency.mdb.AbstractEaiMDB.onMessage(AbstractEaiMDB.java:46)

              Could you post the code for the onMessage method and identify line 46?

              • 4. Re: Migrating application from Websphere to Jboss
                tosaurav

                Thanks PeterJ, You were correct ,it's the problem with the class in onMessage method.Here is the code

                public void onMessage(javax.jms.Message mesg) {
                try {
                payGovJMSUtil = PayGovJMSUtil.getInstance();
                processMessage(mesg);
                } catch (Exception e) {
                e.printStackTrace();
                throw new EJBException(e.getMessage());
                }
                return;
                }


                But i copied the jar file in which this class(PayGovJMSUtil) exist in server deploy folder along with MDB jar. Looks like its not getting.Please tell me what is the class loader policy and sequence in JBOSS and which is the correct place to put helper jars.


                • 5. Re: Migrating application from Websphere to Jboss
                  peterj

                  I assume that PayGovJMSUtil is in some other jar file containing various business and utility classes that will also be required. If so, the best thing to do is create an ear archive containing both the utility jar file and the ejb jar file.