3 Replies Latest reply on Nov 1, 2004 11:32 AM by Anil Saldanha

    My MDB does't work in singleton mod on cluster. Help me.

    Alex Newbie

      I write simple MDB Bean. It's catch message and print this message.

      My OnMessage function is:

      Code:
      public void onMessage(Message msg) {
      TextMessage tm = (TextMessage) msg;
      try
      {
      System.out.println("onMessageMDB, recv text="
      + tm.getText());
      }
      catch(Throwable t)
      {
      t.printStackTrace();
      }
      }


      ejb-jar:
      Code:
      <ejb-jar>
      <enterprise-beans>
      <message-driven>
      <display-name>Enterprise1</display-name>
      <ejb-name>MyMDB</ejb-name>
      <ejb-class>testcluster.MyMDBBean</ejb-class>
      <transaction-type>Bean</transaction-type>
      <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
      <message-driven-destination>
      <destination-type>javax.jms.Queue</destination-type>
      </message-driven-destination>
      </message-driven>
      </enterprise-beans>
      <assembly-descriptor>
      <container-transaction>
      
      <ejb-name>MyMDB</ejb-name>
      <method-name>*</method-name>
      
      <trans-attribute>Required</trans-attribute>
      </container-transaction>
      </assembly-descriptor>
      </ejb-jar>




      jboss.xml is:
      Code:

      <enterprise-beans>
      <message-driven>
      <configuration-name>Singleton Message Driven Bean</configuration-name>
      <ejb-name>MyMDB</ejb-name>
      <destination-jndi-name>queue/testQueue</destination-jndi-name>
      </message-driven>
      </enterprise-beans>




      Then I send message to Queue MDB work fine, catch message and print it.
      But after some time i catch exceptin in my jboss log file
      Code:
      15:21:03,765 ERROR [DLQHandler] Stopping failed DLQHandler
      org.jboss.mq.SpyJMSException: Cannot disable the connection with the JMS server;
      - nested throwable: (java.io.IOException: Client is not connected)
      at org.jboss.mq.Connection.doStop(Connection.java:1289)
      at org.jboss.mq.Connection.stop(Connection.java:718)
      at org.jboss.ejb.plugins.jms.DLQHandler.stopService(DLQHandler.java:184)
      
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSu
      pport.java:319)
      at org.jboss.system.ServiceMBeanSupport.stop(ServiceMBeanSupport.java:18
      2)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalDestroy(ServiceMBea
      nSupport.java:355)
      at org.jboss.system.ServiceMBeanSupport.destroy(ServiceMBeanSupport.java
      :197)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker.destroyService(JMSConta
      inerInvoker.java:894)
      at org.jboss.ejb.plugins.jms.JMSContainerInvoker$ExceptionListenerImpl.o
      nException(JMSContainerInvoker.java:1271)
      at org.jboss.mq.Connection.asynchFailure(Connection.java:446)
      at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILServ
      ice.java:145)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.
      java:400)
      at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:33
      2)
      at java.lang.Thread.run(Thread.java:534)
      Caused by: java.io.IOException: Client is not connected
      at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.
      java:226)
      at org.jboss.mq.il.uil2.SocketManager.sendMessage(SocketManager.java:192
      )
      at org.jboss.mq.il.uil2.UILServerIL.setEnabled(UILServerIL.java:162)
      at org.jboss.mq.Connection.doStop(Connection.java:1285)
      ... 13 more
      15:21:03,796 INFO [JMSContainerInvoker] Reconnected to JMS provider

      and Log file:

      2004-09-29 12:17:07,390 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Initializing
      2004-09-29 12:17:07,390 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Looking up provider adapter: java:/DefaultJMSProvider
      2004-09-29 12:17:07,390 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Provider adapter: org.jboss.jms.jndi.JNDIProviderAdapter@14fa79d
      2004-09-29 12:17:07,390 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Creating DLQHandler
      2004-09-29 12:17:07,390 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
      2004-09-29 12:17:07,421 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory[server=org.jboss.mq.il.uil2.UILServerIL@81db25 connectionProperties={UIL_ADDRESS_KEY=192.168.6.15, UIL_CHUNKSIZE_KEY=1000000, UIL_TCPNODELAY_KEY=yes, ClientILService=org.jboss.mq.il.uil2.UILClientILService, UIL_PORT_KEY=8093, UIL_BUFFERSIZE_KEY=2048, PingPeriod=60000}]
      2004-09-29 12:17:07,437 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Using factory: org.jboss.mq.SpyXAConnectionFactory@15a740a
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
      2004-09-29 12:17:07,437 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.UILClientILService] Starting
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Setting up the UILClientIL Connection
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] The UILClientIL Connection is set up
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Created connection: Connection@32398134[token=ConnectionToken:null/7c53c50683d55513d7213a32e00ac80f rcvstate=STOPPED]
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.referenceable.SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Using Queue: QUEUE.DLQ
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Created DLQHandler
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] context: javax.naming.InitialContext@1a65a18
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] jndiSuffix: testQueue
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Got destination type Queue for MyMDB
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] Extracting SpyConnectionFactory from reference
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.referenceable.SpyConnectionFactoryObjectFactory] The GenericConnectionFactory is: GenericConnectionFactory[server=org.jboss.mq.il.uil2.UILServerIL@64eff0 connectionProperties={UIL_ADDRESS_KEY=192.168.6.15, UIL_CHUNKSIZE_KEY=1000000, UIL_TCPNODELAY_KEY=yes, ClientILService=org.jboss.mq.il.uil2.UILClientILService, UIL_PORT_KEY=8093, UIL_BUFFERSIZE_KEY=2048, PingPeriod=60000}]
      2004-09-29 12:17:07,453 DEBUG [org.jboss.jms.ConnectionFactoryHelper] using connection factory: org.jboss.mq.SpyXAConnectionFactory@c4b664
      2004-09-29 12:17:07,453 DEBUG [org.jboss.jms.ConnectionFactoryHelper] using username/password: null/null
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin ReadTask.run
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Begin WriteTask.run
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectOutputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.SocketManager] Created ObjectInputStream
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.UILClientILService] Starting
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Setting up the UILClientIL Connection
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] The UILClientIL Connection is set up
      2004-09-29 12:17:07,453 DEBUG [org.jboss.jms.ConnectionFactoryHelper] created XAQueueConnection: Connection@1276873[token=ConnectionToken:null/2a3862867adbadf5b55dae7fafc898b6 rcvstate=STOPPED]
      2004-09-29 12:17:07,453 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Using client id: null
      2004-09-29 12:17:07,453 DEBUG [org.jboss.mq.referenceable.SpyDestinationObjectFactory] SpyDestinationObjectFactory->getObjectInstance()
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] looking up session pool factory: java:/StdJMSPool
      2004-09-29 12:17:07,468 DEBUG [org.jboss.jms.asf.StdServerSessionPool] initializing with connection: Connection@1276873[token=ConnectionToken:null/2a3862867adbadf5b55dae7fafc898b6 rcvstate=STOPPED]
      2004-09-29 12:17:07,468 DEBUG [org.jboss.jms.asf.StdServerSession] initializing (pool, session, xaSession, useLocalTX): org.jboss.jms.asf.StdServerSessionPool@985fa2, SpySession@33343401[tx=true txid=null XA RUNNING connection=Connection@1276873[token=ConnectionToken:ID:3/2a3862867adbadf5b55dae7fafc898b6 rcvstate=STOPPED]], SpySession@33343401[tx=true txid=null XA RUNNING connection=Connection@1276873[token=ConnectionToken:ID:3/2a3862867adbadf5b55dae7fafc898b6 rcvstate=STOPPED]], true
      2004-09-29 12:17:07,468 DEBUG [org.jboss.jms.asf.StdServerSessionPool] added server session to the pool: org.jboss.jms.asf.StdServerSession@1ae9565
      2004-09-29 12:17:07,468 DEBUG [org.jboss.jms.asf.StdServerSessionPool] Server Session pool set up
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Server session pool: org.jboss.jms.asf.StdServerSessionPool@985fa2
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Connection consumer: SpyConnectionConsumer[sub=Subscription[subId=-2147483648connection=ConnectionToken:ID:3/2a3862867adbadf5b55dae7fafc898b6 destination=QUEUE.testQueue messageSelector=null Local Create] messages=0 waitingForMessage=false internalThread=Thread[Connection Consumer for dest Subscription[subId=-2147483648connection=ConnectionToken:ID:3/2a3862867adbadf5b55dae7fafc898b6 destination=QUEUE.testQueue messageSelector=null Local Create] id=2,5,JBossMQ Client Threads] sessionPool=org.jboss.jms.asf.StdServerSessionPool@985fa2 connection=Connection@1276873[token=ConnectionToken:ID:3/2a3862867adbadf5b55dae7fafc898b6 rcvstate=STOPPED]]
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Initialized with config org.jboss.ejb.plugins.jms.JMSContainerInvoker@44c4a4{ maxMessagesNr=1, maxPoolSize=1, reconnectInterval=10000, providerAdapterJNDI=java:/DefaultJMSProvider, serverSessionPoolFactoryJNDI=java:/StdJMSPool, acknowledgeMode=1, isContainerManagedTx=false, isNotSupportedTx=false, useDLQ=true, dlqHandler=org.jboss.ejb.plugins.jms.DLQHandler@169be56{ destinationJNDI=queue/DLQ, maxResent=10, timeToLive=0 } }
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Starting DLQHandler
      2004-09-29 12:17:07,468 DEBUG [org.jboss.ejb.plugins.jms.DLQHandler] Started DLQHandler
      2004-09-29 12:17:07,468 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Reconnected to JMS provider
      2004-09-29 12:17:07,468 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
      java.net.SocketTimeoutException: Read timed out
       at java.net.SocketInputStream.socketRead0(Native Method)
       at java.net.SocketInputStream.read(SocketInputStream.java:129)
       at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
       at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
       at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67)
       at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
       at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313)
       at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380)
       at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452)
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
       at java.lang.Thread.run(Thread.java:534)
      2004-09-29 12:18:17,984 WARN [org.jboss.mq.Connection] Connection failure:
      org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.io.EOFException)
       at org.jboss.mq.Connection.asynchFailure(Connection.java:436)
       at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:400)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: java.io.EOFException
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2603)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
       ... 1 more
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.SocketManager] End WriteTask.run
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.SocketManager] End ReadTask.run
      2004-09-29 12:18:17,984 DEBUG [org.jboss.mq.il.uil2.ServerSocketManagerHandler] Exiting on IOE
      java.net.SocketTimeoutException: Read timed out
       at java.net.SocketInputStream.socketRead0(Native Method)
       at java.net.SocketInputStream.read(SocketInputStream.java:129)
       at java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
       at java.io.BufferedInputStream.read(BufferedInputStream.java:201)
       at org.jboss.util.stream.NotifyingBufferedInputStream.read(NotifyingBufferedInputStream.java:67)
       at java.io.ObjectInputStream$PeekInputStream.peek(ObjectInputStream.java:2133)
       at java.io.ObjectInputStream$BlockDataInputStream.readBlockHeader(ObjectInputStream.java:2313)
       at java.io.ObjectInputStream$BlockDataInputStream.refill(ObjectInputStream.java:2380)
       at java.io.ObjectInputStream$BlockDataInputStream.read(ObjectInputStream.java:2452)
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2601)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
       at java.lang.Thread.run(Thread.java:534)
      2004-09-29 12:18:18,000 WARN [org.jboss.ejb.plugins.jms.JMSContainerInvoker] JMS provider failure detected:
      org.jboss.mq.SpyJMSException: Exiting on IOE; - nested throwable: (java.io.EOFException)
       at org.jboss.mq.Connection.asynchFailure(Connection.java:436)
       at org.jboss.mq.il.uil2.UILClientILService.asynchFailure(UILClientILService.java:145)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.handleStop(SocketManager.java:400)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:332)
       at java.lang.Thread.run(Thread.java:534)
      Caused by: java.io.EOFException
       at java.io.ObjectInputStream$BlockDataInputStream.readByte(ObjectInputStream.java:2603)
       at java.io.ObjectInputStream.readByte(ObjectInputStream.java:845)
       at org.jboss.mq.il.uil2.SocketManager$ReadTask.run(SocketManager.java:279)
       ... 1 more
      2004-09-29 12:18:18,000 INFO [org.jboss.ejb.plugins.jms.JMSContainerInvoker] Trying to reconnect to JMS provider


      And that exception apperance pereodicali after first invocation my MDB.
      I use JBoss 4.0RC2 in all configuration and Win2K. May be i need special configuration for Jboss?.