All,
I'm using Spring 2.5.6 sec02. I recently added a unit test that depends on the spring container. Among the beans is a DefaultMessageListenerContainer. However when the test runs in Ant and tries to exit, it hangs forever with this stack trace in the thread dump:
Line 489 is this.lifecycleMonitor.wait();Code:Oracle JRockit(R) R28.2.3-13-149708-1.5.0_34-20120327-1523-windows-ia32 "Main Thread" id=1 idx=0x4 tid=6248 prio=5 alive, waiting, native_blocked -- Waiting for notification on: java/lang/Object@0x11DFF950[fat lock] at jrockit/vm/Threads.waitForNotifySignal(JLjava/lang/Object;)Z(Native Method) at java/lang/Object.wait(J)V(Native Method) at java/lang/Object.wait(Object.java:474) at org/springframework/jms/listener/DefaultMessageListenerContainer.doShutdown(DefaultMessageListenerContainer.java: 489) ^-- Lock released while waiting: java/lang/Object@0x11DFF950[fat lock] at org/springframework/jms/listener/AbstractJmsListeningContainer.shutdown(AbstractJmsListeningContainer.java:211) at org/springframework/jms/listener/AbstractJmsListeningContainer.destroy(AbstractJmsListeningContainer.java:149) at org/springframework/beans/factory/support/DisposableBeanAdapter.destroy(DisposableBeanAdapter.java:151) at org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.destroyBean(DefaultSingletonBeanRegistry.j ava:487) at org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.destroySingleton(DefaultSingletonBeanRegis try.java:462) at org/springframework/beans/factory/support/DefaultSingletonBeanRegistry.destroySingletons(DefaultSingletonBeanRegi stry.java:430) ^-- Holding lock: java/util/LinkedHashMap@0x109F7078[biased lock] at org/springframework/context/support/AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:853) at org/springframework/context/support/AbstractApplicationContext.doClose(AbstractApplicationContext.java:831) at org/springframework/context/support/AbstractApplicationContext.close(AbstractApplicationContext.java:794)
Interestingly, AbstractApplicationContext.close doesn't get called when I run the test in IntelliJ 11 and the test exits normally. Perhaps it's disabling the shutdown hook somehow. I haven't used Spring JMS before but have done a lot of non-Spring JMS and my config looks pretty vanilla to me.
Any hints on what's going on?
Thanks
Here is my config:
Code:<bean id="customerListenerContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer"> <property name="concurrentConsumers" value="1" /> <!-- never use more than 1 consumer for a topic --> <property name="maxConcurrentConsumers" value="1" /> <property name="sessionTransacted" value="true" /> <property name="connectionFactory" ref="myConnectionFactory" /> <property name="destination" ref="customerDestination" /> <property name="messageListener" ref="customerListener" /> <property name="pubSubDomain" value="true" /> <property name="clientId" value="cps" /> <property name="durableSubscriptionName" value="customerConsumer" /> <property name="subscriptionDurable" value="true" /> </bean>


Reply With Quote