4 Replies Latest reply on Oct 22, 2010 12:08 PM by clebert.suconic

    Embedded HornetQ not stopping correctly

    teto

      Hi,

       

      I'm running an embedded HornetQ instance and I can't get it to stop completely. Two non-daemon threads stay around and I suspect they are not from the HornetQ server but from the JNDI server, these are the stack traces for them as reported by Eclipse:

       

       

      Thread [Naming Bootstrap#2] (Suspended)
      Unsafe.park(boolean, long) line: not available [native method]
      LockSupport.park(Object) line: 186
      AbstractQueuedSynchronizer$ConditionObject.await() line: 2043
      LinkedBlockingQueue<E>.take() line: 386
      ThreadPoolExecutor.getTask() line: 1043
      ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1103
      ThreadPoolExecutor$Worker.run() line: 603
      Thread.run() line: 636
      Thread [Naming Bootstrap#1] (Suspended)
      Unsafe.park(boolean, long) line: not available [native method]
      LockSupport.park(Object) line: 186
      AbstractQueuedSynchronizer$ConditionObject.await() line: 2043
      LinkedBlockingQueue<E>.take() line: 386
      ThreadPoolExecutor.getTask() line: 1043
      ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1103
      ThreadPoolExecutor$Worker.run() line: 603
      Thread.run() line: 636

      Thread [Naming Bootstrap#2] (Suspended)

      Unsafe.park(boolean, long) line: not available [native method]

      LockSupport.park(Object) line: 186

      AbstractQueuedSynchronizer$ConditionObject.await() line: 2043

      LinkedBlockingQueue<E>.take() line: 386

      ThreadPoolExecutor.getTask() line: 1043

      ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1103

      ThreadPoolExecutor$Worker.run() line: 603

      Thread.run() line: 636

       

      Thread [Naming Bootstrap#1] (Suspended)

      Unsafe.park(boolean, long) line: not available [native method]

      LockSupport.park(Object) line: 186

      AbstractQueuedSynchronizer$ConditionObject.await() line: 2043

      LinkedBlockingQueue<E>.take() line: 386

      ThreadPoolExecutor.getTask() line: 1043

      ThreadPoolExecutor.runWorker(ThreadPoolExecutor$Worker) line: 1103

      ThreadPoolExecutor$Worker.run() line: 603

      Thread.run() line: 636

       

      They seem to be stuck waiting on a BlockingQueue. I'm using the embedded example as a guideline, but in the example System.exit(0) is executed right after stopping the resources:

       

      jmsServer.stop();

      naming.stop();

      jndiServer.stop();

      System.exit(0);

       

      I can't call system.exit(0) in my application. Any ideas about what could be going on? I'm using HornetQ 2.1.2.Final. Thanks in advance.