1 Reply Latest reply on May 14, 2003 4:05 PM by adrian.brock

    MDB Processing the Message before the ear is deployed.

    sharath_neo

      I have an ear file which consists of a couple of entity beans and session beans. and finally 2 MDB. I am using the same JMS server provided by JBoss 3.2.0. These mdb will inturn call the session beans existing in the ear. when i am starting up the server if Queue defined, has some messages. These messages are getting delivered to the mdb before whole application is deployed. Which raises an exception saying that one such session bean defined inside the ear is not bound. The exception is pasted below.


      16:36:24,331 INFO [STDOUT] javax.naming.NameNotFoundException: ScenarioProcessor not bound
      16:36:24,331 ERROR [STDERR] javax.naming.NameNotFoundException: ScenarioProcessor not bound
      16:36:24,331 ERROR [STDERR] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:245)
      16:36:24,331 ERROR [STDERR] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:220)
      16:36:24,331 ERROR [STDERR] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:122)
      16:36:24,331 ERROR [STDERR] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
      16:36:24,331 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:492)
      16:36:24,331 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      16:36:24,331 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:350)
      16:36:24,331 ERROR [STDERR] at com.ikigo.server.ServiceLocator.getRemoteHome(ServiceLocator.java:134)
      16:36:24,331 ERROR [STDERR] at com.ikigo.server.ejbs.scenarioprocessorsession.scenarioqueuehandler.ScenarioQueueHandler.onMessage(ScenarioQueueHandler.java:140)
      16:36:24,331 ERROR [STDERR] at java.lang.reflect.Method.invoke(Native Method)
      16:36:24,331 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:434)
      16:36:24,331 ERROR [STDERR] at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:186)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.java:62)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.RunAsSecurityInterceptor.invoke(RunAsSecurityInterceptor.java:90)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:191)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor.invoke(ProxyFactoryFinderInterceptor.java:122)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.MessageDrivenContainer.internalInvoke(MessageDrivenContainer.java:348)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.Container.invoke(Container.java:674)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:706)
      16:36:24,341 ERROR [STDERR] at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.java:994)
      16:36:24,341 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:241)
      16:36:24,341 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:636)
      16:36:24,341 ERROR [STDERR] at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:442)
      16:36:24,341 ERROR [STDERR] at org.jboss.mq.SpySession.run(SpySession.java:294)
      16:36:24,351 ERROR [STDERR] at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:177)
      16:36:24,351 ERROR [STDERR] at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)

      thanks in advace

        • 1. Re: MDB Processing the Message before the ear is deployed.

          In jboss.xml you can
          add the following to your MDB to make sure it
          is started after the bean it uses.

          jboss.j2ee:service=EJB,jndiName=whatever

          There is known problem with this not working
          for a CMP entity bean.

          There is a recent unreleased fix that allows you
          to add a dependency to the ejb jar
          which will wait for everything with no other
          dependency to be deployed.

          Regards,
          Adrian