1 Reply Latest reply on Feb 8, 2007 9:03 AM by wjq

    Error when close Consumer

    wjq Newbie

      I hava a message consumer created like this

      ... ...
      consumer = session.createConsumer(destination);
      ... ...

      the code run successful on startup(as a spring bean).but when close at server shutdown using code:
      ... ...
      ... ...

      there raise an Exception:
      2007-02-08 10:56:21,197 ERROR [postRegist.JmsListener] Exception when close JMS consumer.
      javax.jms.JMSException: The subscription had not been previously registered
       at org.jboss.mq.server.ClientConsumer.removeSubscription(ClientConsumer.java:248)
       at org.jboss.mq.server.JMSDestinationManager.unsubscribe(JMSDestinationManager.java:548)
       at org.jboss.mq.server.JMSServerInterceptorSupport.unsubscribe(JMSServerInterceptorSupport.j
      ... ...

      According to the log , the server has successfully startup,all queue been inited and my jms listener been created successfully too. the above Exception raised only at the server shutdown.

      What is the problem ?


        • 1. Re: Error when close Consumer
          wjq Newbie

          I have figured out the reason.Simply speaking ,the reason is when the consomer closing,the queue it depended has be stopped.

          to work around it,simply add a "depends" entry in my mbean define descriptor(the jboss-service.xml),making the jms consumer mbean depend on the queue. then at server shutdown these mbean will be stopped in a right order. great!