0 Replies Latest reply on Jan 3, 2007 12:27 PM by Michael Harris

    IllegalStateException (The connection is closed) after heavy

    Michael Harris Newbie

      We are using JBossMQ with JBoss version 4.0.2 and 4.0.4

      We have a configuration with a JMS client connected to JMS queues. There are two JMS queues a request queue and response queue. The web app running under JBoss can submit requests for statistical analysis to the request queue. The JMS client listens to the request queue processes the request and puts the result on the result queue. The web app listens to the result queue picks up the results and displays them.

      Everything works fine until we do heavy stress testing. Note that we are using DeliveryMode.NON_PERSISTENT . After many successful messages have been sent and processed, we get the exception:

      "javax.jms.IllegalStateException: The connection is closed" when trying to send back the result via JMS.

      The code to send the results back is:

      try {

      // Is there a way to test the queueConnection here so that
      // I can reestablish the connection if it is broken or closed ??

      QueueSession resultSession =

      ObjectMessage msg = resultSession.createObjectMessage(result);

      Queue resultQueue = (Queue) resultDestination;

      QueueSender resultSender =

      resultSender.send(msg, DeliveryMode.NON_PERSISTENT,

      } catch (JMSException ex) {
      logger.error("Caught JMS exception when trying to send result.");
      } catch (Exception ex) {
      logger.error("Caught exception when trying to send result.");

      Two questions:

      a) Is this a bug in the JBossMQ? We are not getting a JMS onException() call for the borken/closed connection like you would for ping timeout.

      b) Is there a way to test the status of the connection (i.e. someting like a method connection.isClosed() ) to see if it is broken or closed so that the connection can be reestablished?