1 Reply Latest reply on Sep 14, 2007 6:33 AM by adrian.brock

    Exception occurs even when connection exists

    adoorsarath

      Sir,

      I have a JMS application running in Tomcat.

      I have timer task which will retrieve messages from JBossMQ Queue

      When I stop the JBoss,the JMS application throws the Exception in the

      following code snippet

      message = (TextMessage)messenger.receiveNoWait( destination );


      Cannot subscribe to this Destination: Client is not connected; - nested throwabl
      e: (java.io.IOException: Client is not connected)
      org.jboss.mq.SpyJMSException: Cannot subscribe to this Destination: Client is no
      t connected; - nested throwable: (java.io.IOException: Client is not connected)
      at org.jboss.mq.Connection.addConsumer(Connection.java:1094)
      at org.jboss.mq.SpySession.addConsumer(SpySession.java:753)
      at org.jboss.mq.SpyQueueSession.createReceiver(SpyQueueSession.java:105)

      at org.apache.commons.messenger.MessengerSupport.createMessageConsumer(M
      essengerSupport.java:909)
      at org.apache.commons.messenger.MessengerSupport.getMessageConsumer(Mess
      engerSupport.java:871)
      at org.apache.commons.messenger.MessengerSupport.receiveNoWait(Messenger
      Support.java:285)
      at org.amma.atech.hmos.sms.JMSResponseHandler.run(JMSResponseHandler.jav
      a:81)
      at java.util.TimerThread.mainLoop(Timer.java:432)
      at java.util.TimerThread.run(Timer.java:382)
      Caused by: java.io.IOException: Client is not connected
      at org.jboss.mq.il.uil2.SocketManager.internalSendMessage(SocketManager.
      java:225)
      at org.jboss.mq.il.uil2.SocketManager.sendMessage(SocketManager.java:189
      )
      at org.jboss.mq.il.uil2.UILServerIL.subscribe(UILServerIL.java:463)
      at org.jboss.mq.Connection.addConsumer(Connection.java:1082)
      ... 8 more

      I have caught the Exception and written code to reconnect to the
      Application Server.


      But Still it is throwing the Same Exception .But it doesn't throw any
      exception while connecting to the server and looking up the destination.


      If any body Knows the Solution,please help me..