0 Replies Latest reply on Mar 2, 2004 9:42 AM by Bob Sturim

    MDB Exception in JMSCI message listener

    Bob Sturim Newbie

      I've defined my MDB, and it picks up messages off the queue no problem. Now it's time to make it do something interesting. So I instantiate a data access object based on the content on the message. The data access object is a simple object with public getters and setters.

      A streamlined version my MDB is:

      public void onMessage(Message message)
      {
       B2BMessage b2bMessage = new org.sturim.rbs.entity.b2b.B2BMessage();
       String dependentMessageId =
       message.getStringProperty(ExternalMessageHelper.DEPENDENT_MESSAGE_ID);
       b2bMessage.setDependentMsg(dependentMessageId);
      }


      I can instantiate my object from within my MDB no problem (and I can verify from within the debugger that the correct object is created). But as soon as I try to access any of the setter methods, I get:

      22:53:55,062 ERROR [LogInterceptor] Unexpected Error:
      java.lang.NoSuchMethodError: org.sturim.rbs.entity.b2b.B2BMessage.setDependentMsg(Ljava/lang/String;)V
       at org.sturim.rbs.b2b.ProcessExternalInboundMessageBean.onMessage(ProcessExternalInboundMessageBean.java:225)
       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:324)
       at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
       at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
       at org.jboss.ejb.Container.invoke(Container.java:700)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
       at org.jboss.mq.SpySession.run(SpySession.java:298)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
       at java.lang.Thread.run(Thread.java:534)
      22:53:55,078 ERROR [JMSContainerInvoker] Exception in JMSCI message listener
      javax.ejb.EJBException: Unexpected Error
      java.lang.NoSuchMethodError: org.sturim.rbs.entity.b2b.B2BMessage.setDependentMsg(Ljava/lang/String;)V
       at org.sturim.rbs.b2b.ProcessExternalInboundMessageBean.onMessage(ProcessExternalInboundMessageBean.java:225)
       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:324)
       at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:460)
       at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:185)
       at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
       at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
       at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:240)
       at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:128)
       at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
       at org.jboss.ejb.Container.invoke(Container.java:700)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
       at org.jboss.mq.SpySession.run(SpySession.java:298)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
       at java.lang.Thread.run(Thread.java:534)
      
       at org.jboss.ejb.plugins.LogInterceptor.handleException(LogInterceptor.java:370)
       at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
       at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
       at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:374)
       at org.jboss.ejb.Container.invoke(Container.java:700)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:824)
       at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:1114)
       at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:256)
       at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:633)
       at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:433)
       at org.jboss.mq.SpySession.run(SpySession.java:298)
       at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:180)
       at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
       at java.lang.Thread.run(Thread.java:534)


      I basically get the same exception even if I try a different setter, so it's not a problem with any one setter method.

      This seems pretty straight forward, but I'm not sure what I'm doing wrong. I did not define a security role for my bean. Is that my problem? And if so, can someone point me to a simple example?

      Thanks very much.