4 Replies Latest reply on Mar 27, 2006 8:58 AM by Björn Eilers

    NoClassDefFoundError with message-driven bean

    Björn Eilers Newbie

      Hi!

      I have deployed a message-driven in JBoss 4.0.3RC1 whose onMessage() method creates an instance of an utility object that I have deployed within the same JAR file as the MDB. However, whenever I send a message to the Topic that the bean is listening to, I receive a NoClassDefFoundError saying that the class describing this utility object cannot be found.

      Is there some configuration in ejb-jar.xml, jboss.xml or the MANIFEST.MF I have to set?

      Thanks and best regards,
      Björn

        • 1. Re: NoClassDefFoundError with message-driven bean
          jaikiran pai Master

          Post the stacktrace. NoClassDefFoundError is thrown when the classes referenced by a class are not found in the classpath

          • 2. Re: NoClassDefFoundError with message-driven bean
            Björn Eilers Newbie

            Sure, here it is:

            14:53:55,783 ERROR [JMSContainerInvoker] Exception in JMSCI message listener
            javax.ejb.TransactionRolledbackLocalException: Unexpected Error
            java.lang.NoClassDefFoundError: gruppe00/clairline/CLAirlineServiceLocator
             at gruppe00.eaibymom.wsmdb.CLAirlineBean.handleInfoRequest(CLAirlineBean.java:92)
             at gruppe00.eaibymom.wsmdb.CLAirlineBean.onMessage(CLAirlineBean.java:71)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(MessageDrivenContainer.java:487)
             at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
             at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
             at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
             at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
             at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
             at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
             at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
             at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
             at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:401)
             at org.jboss.ejb.Container.invoke(Container.java:917)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
             at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
             at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:902)
             at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
             at org.jboss.mq.SpySession.run(SpySession.java:323)
             at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
             at java.lang.Thread.run(Thread.java:595)
            
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:262)
             at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
             at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
             at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
             at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
             at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
             at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:401)
             at org.jboss.ejb.Container.invoke(Container.java:917)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
             at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:26
            6)
             at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:902)
             at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
             at org.jboss.mq.SpySession.run(SpySession.java:323)
             at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
             at java.lang.Thread.run(Thread.java:595)
            Caused by: javax.ejb.EJBException: Unexpected Error
            java.lang.NoClassDefFoundError:gruppe00/clairline/CLAirlineServiceLocator
             at gruppe00.eaibymom.wsmdb.CLAirlineBean.handleInfoRequest(CLAirlineBean
            .java:92
             at gruppe00.eaibymom.wsmdb.CLAirlineBean.onMessage(CLAirlineBean.java:71)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.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(MessageDrivenContainer.java:487)
             at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:158)
             at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:116)
             at org.jboss.ejb.plugins.CallValidationInterceptor.invoke(CallValidationInterceptor.java:63)
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:121)
             at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:350)
             at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:181)
             at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:109)
             at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:206)
             at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:136)
             at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:401)
             at org.jboss.ejb.Container.invoke(Container.java:917)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:987)
             at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1287)
             at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:266)
             at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:902)
             at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:170)
             at org.jboss.mq.SpySession.run(SpySession.java:323)
             at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:194)
             at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:748)
             at java.lang.Thread.run(Thread.java:595)
            
             at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:237)
             ... 16 more
            14:53:55,783 WARN [DLQHandler] Message resent too many times; sending it to DLQ
            ; message id=ID:50-11434640333171


            • 3. Re: NoClassDefFoundError with message-driven bean
              jaikiran pai Master

              The class(es) referred by gruppe00/clairline/CLAirlineServiceLocator, through the import statement or through the extends statement or through someother means are not there in the classpath. Make sure that all the appropriate jars/classes required by this gruppe00/clairline/CLAirlineServiceLocator are placed in the classpath

              • 4. Re: NoClassDefFoundError with message-driven bean
                Björn Eilers Newbie

                Thanks for you help - it was a JAR file that was missing from the classpath.