3 Replies Latest reply on Jul 24, 2002 2:44 PM by schaefera

    NoSuchMethodException on MDB

    aoldcorn

      I hope someone has seen this before. I have a simple MDB that is listening to a topic (ordersReceived) and in the onMessage() method it takes the message received and puts it onto another topic (email). I have a standard JMS client publishing to the ordersReceived topic. The messages arrive on the topic correctly because when they do the following happens:

      [ERROR,JMSContainerInvoker] Exception in JMSCI message listener
      java.lang.NoSuchMethodException
      at java.lang.Class.getMethod0(Native Method)
      at java.lang.Class.getMethod(Class.java:888)
      at org.jboss.ejb.MessageDrivenEnterpriseContext.(MessageDrivenEnte
      rpriseContext.java:59)
      at org.jboss.ejb.plugins.MessageDrivenInstancePool.create(MessageDrivenI
      nstancePool.java:58)
      at org.jboss.ejb.plugins.AbstractInstancePool.add(AbstractInstancePool.j
      ava:153)
      at org.jboss.ejb.plugins.AbstractInstancePool.internalGet(AbstractInstan
      cePool.java:216)
      at org.jboss.ejb.plugins.AbstractInstancePool.get(AbstractInstancePool.j
      ava:191)
      at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(Message
      DrivenInstanceInterceptor.java:73)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.ja
      va:138)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxIntercep
      torCMT.java:277)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:1
      00)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.
      java:127)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
      at org.jboss.ejb.MessageDrivenContainer.invoke(MessageDrivenContainer.ja
      va:281)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvo
      ker.java:584)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onM
      essage(JMSContainerInvoker.java:930)
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:23
      3)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMess
      ageConsumer.java:565)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:37
      6)
      at org.jboss.mq.SpySession.run(SpySession.java:248)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:172)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExec
      utor.java:725)

      Can anyone help?

        • 1. Re: NoSuchMethodException on MDB
          hchirino

          your MDB does not seem to be follng the EJB spec. Did you implement all the required methods.

          • 2. Re: NoSuchMethodException on MDB
            aoldcorn

            Well, absolutely. I have checked that many times.

            I took the example of HelloMDB in the samples and was able to deploy this. I changed the code within this to do what my MDB was trying to do and it worked. So I decided to redeploy my original bean, but it still didn't even though it was now identical to the HelloMDB. So, for no particular reason, I changed the name of my class from OrderReceivedMDB.java to ReceivedMDB.java, re-compiled, reployed and it worked !

            So, this is either a very bizarre, obscure bug or during the course of these steps I went through changed something else that enabled it to work (not 100% sure, but I don't believe I did).

            Sorry the solution is no more technical !

            • 3. Re: NoSuchMethodException on MDB
              schaefera

              Hi

              Can you send me the "failing" application so that I can check what really causes the problem. I can't believe that the renaming was the solution. My email is andreas@jboss.org.

              Have fun - Andy