title: Spring JMS DefaultMessageListenerContainer threads are in Blocked state on isRunning()
body: <p>One of our older project version is using spring JMS 4.0.2 with active mq 5.10 and we've a situation of a component sending out messages to active mq Q and other component is receiving it.</p>
  
  <p>After around 400+ messages getting through, next messages just stuck and never reached to the final destination.</p>
  
  <p>We tracked it to the receiving side where spring JMS piece is able to get the message but not able to invoke "onMessage" on the listener.</p>
  
  <p>The thread dump of the receiving JVM shows that all those received messages threads are "BLOCKED" on 'isRunning()' which in turn waiting on lock on "lifecycleMonitor" object.</p>
  
  <p>Here is the thread dump analysis:</p>
  
  <p>There were 5 messages received and then those 5 threads are waiting to get lock in (isRunning()) before invoking "onMessage". </p>
  
  <pre><code>85 threads with same stack trace Thread 246 Thread 246 - threadId:Thread 246 - state:BLOCKED stackTrace:
  - java.lang.Object.wait(long) @bci=0 (Compiled frame; information may be imprecise)
  - java.lang.Object.wait() @bci=2, line=502 (Compiled frame)
  - org.apache.activemq.FifoMessageDispatchChannel.dequeue(long) @bci=49, line=72 (Compiled frame)
  - org.apache.activemq.ActiveMQMessageConsumer.dequeue(long) @bci=19, line=486 (Compiled frame)
  - org.apache.activemq.ActiveMQMessageConsumer.receive() @bci=17, line=573 (Compiled frame)
  - org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveMessage(javax.jms.MessageConsumer) @bci=10, line=430 (Compiled frame)
  - org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer, org.springframework.transaction.TransactionStatus) @bci=119, line=310 (Compiled frame)
  - org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer) @bci=94, line=263 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener() @bci=17, line=1102 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=82, line=996 (Compiled frame)
  - org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
  - de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
  - java.lang.Thread.run() @bci=11, line=745 (Compiled frame)
  
  38 threads with same stack trace Thread 231 Thread 231 - threadId:Thread 231 - state:BLOCKED stackTrace:
  - org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning() @bci=6, line=347 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=64, line=995 (Compiled frame)
  - org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
  - de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
  - java.lang.Thread.run() @bci=11, line=745 (Compiled frame)
  
  5 threads with same stack trace Thread 126 Thread 126 - threadId:Thread 126 - state:BLOCKED stackTrace:
  - org.springframework.jms.listener.AbstractJmsListeningContainer.isRunning() @bci=6, line=347 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer.scheduleNewInvokerIfAppropriate() @bci=1, line=715 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer.messageReceived(java.lang.Object, javax.jms.Session) @bci=9, line=692 (Compiled frame)
  - org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer, org.springframework.transaction.TransactionStatus) @bci=222, line=317 (Compiled frame)
  - org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(java.lang.Object, javax.jms.Session, javax.jms.MessageConsumer) @bci=94, line=263 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener() @bci=17, line=1102 (Compiled frame)
  - org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run() @bci=82, line=996 (Compiled frame)
  - org.springframework.scheduling.commonj.DelegatingWork.run() @bci=4, line=62 (Compiled frame)
  - de.myfoo.commonj.work.FooWorkItem.run() @bci=112, line=100 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=95, line=1142 (Compiled frame)
  - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=5, line=617 (Compiled frame)
  - java.lang.Thread.run() @bci=11, line=745 (Compiled frame)
  
  2 threads with same stack trace Thread 16 Thread 16 - threadId:Thread 16 - state:BLOCKED
  </code></pre>