1 Reply Latest reply on Sep 25, 2003 1:23 AM by Stephane Nicoll

    MDB consuming messages in the Q while startup

    ovs_nagi Newbie

      HI,
      i have a MDB listening to a Q and has some problems while starting up when the Q has some messages.
      the stack trace from the lookup is here.
      i have also tried depends attribute for MDB like this
      jboss:service=Naming,but no change

      ****************trace******************
      11:48:19,304 WARN [NamingContext] Failed to connect to localhost:1099
      javax.naming.CommunicationException: Failed to connect to server localhost:1099. Root exception is
      javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099. Root exception is
      java.net.ConnectException: Connection refused: connect
      at java.net.PlainSocketImpl.socketConnect(Native Method)
      at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:320)
      at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:133)
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:120)
      at java.net.Socket.(Socket.java:273)
      at java.net.Socket.(Socket.java:177)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:69)
      at org.jnp.interfaces.TimedSocketFactory.createSocket(TimedSocketFactory.java:62)
      at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:187)
      at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1116)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
      at javax.naming.InitialContext.lookup(InitialContext.java:350)
      at com.ikigo.server.ServiceLocator.getRemoteHome(ServiceLocator.java:130)
      at com.ikigo.server.ejbs.scenarioprocessorsession.scenarioqueuehandler.ScenarioQueueHandler.onMessag
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.MessageDrivenContainer$ContainerInterceptor.invoke(MessageDrivenContainer.java:434)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionIntercept
      at org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor.invoke(MessageDrivenInstanceInterceptor.ja
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:84)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:243)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:104)
      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:348)
      at org.jboss.ejb.Container.invoke(Container.java:674)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.invoke(JMSContainerInvoker.java:732)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$MessageListenerImpl.onMessage(JMSContainerInvoker.j
      at org.jboss.jms.asf.StdServerSession.onMessage(StdServerSession.java:241)
      at org.jboss.mq.SpyMessageConsumer.sessionConsumerProcessMessage(SpyMessageConsumer.java:636)
      at org.jboss.mq.SpyMessageConsumer.addMessage(SpyMessageConsumer.java:442)
      at org.jboss.mq.SpySession.run(SpySession.java:294)
      at org.jboss.jms.asf.StdServerSession.run(StdServerSession.java:177)
      at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:727)
      at java.lang.Thread.run(Thread.java:484)

        • 1. Re: MDB consuming messages in the Q while startup
          Stephane Nicoll Master

          You are probably using ressources inside your MDB which have not been deployed yet.

          Let me explain. Assuming you are trying to acceess a session bean to invoke a method on it, you need the naming service to lookup the home interface of the bean. You need also the bean deployed in itself. For that you should put ejb-ref or ejb-external-ref in your MDB definition.

          However, this seems weird to me. I can't imagine a MDB processing while the naming service is not started.

          Does your JBoss starts fine (except this stacktrace?)

          Regards,

          Stephane