1 Reply Latest reply on Oct 4, 2002 4:58 PM by Khurrum Abdullah

    Connection Monitor Thread

    Khurrum Abdullah Newbie

      I am using tomcat 4 and jboss 3.0.2. In my servlet i get a message from MDB. My code works fine and i dont get any kind of exceptions. i close my queue receiver, queue session and queue connection successfuly. When i try to shutdown tomcat i still have some threads running which keeps tomcat from shutting down. I printed that thread and here is the info.
      Thread Name=Connection Monitor Thread
      Alive=true
      isDaemon=true
      groupName =JBossMQ Client Threads
      parentGroup=main

      Here is the code in my servlet
      ----------------------
      QueueConnection qc = null;
      QueueSession qs = null;
      Queue rq = null;
      QueueReceiver qr = null;
      Message m = null;
      InitialContext ic = null;
      try {
      ic = new InitialContext();
      } catch (Exception e) {
      e.printStackTrace();
      }

      Object cfo = null;

      try {
      cfo = ic.lookup("RMIConnectionFactory");
      } catch (NamingException e) {
      e.printStackTrace();
      }

      QueueConnectionFactory qcf = (QueueConnectionFactory) cfo;
      qc = qcf .createQueueConnection();
      rq = (Queue) ic.lookup(MyConstants.USER_QUEUE);
      qs = qc.createQueueSession(false,QueueSession.CLIENT_ACKNOWLEDGE);
      qc.start();
      String selector = "myproperty like b";
      qr = qs.createReceiver(rq,selector);
      m = qr.receiveNoWait();
      qr.close();
      qs.close();
      qc.stop();
      qc.close();
      -----------------------------------

      Any help would be appreciated.