0 Replies Latest reply on Sep 27, 2004 7:24 AM by Alex

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

    Alex Newbie

      I write siple 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 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?.