You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DefaultMessageListenerContainer does not reliably manage its activeInvokerCount, which may prevent it from shutting down. Instead, it will wait indefinitely in
Thread-0@6084, prio=5, in group 'main', status: 'WAIT'
at java.lang.Object.wait(Object.java:-1)
at java.lang.Object.wait(Object.java:485)
at org.springframework.jms.listener.DefaultMessageListenerContainer.doShutdown(DefaultMessageListenerContainer.java:489)
at org.springframework.jms.listener.AbstractJmsListeningContainer.shutdown(AbstractJmsListeningContainer.java:211)
at org.springframework.jms.listener.AbstractJmsListeningContainer.destroy(AbstractJmsListeningContainer.java:149)
In org.springframework.jms.listener.DefaultMessageListenerContainer.AsyncMessageListenerInvoker#run, #decreateActiveInvokerCount will never be called, if an exception is thrown from within the catch(Throwable ex) block, lines 886-908.
In the case at hand, a NPE is caused by https://jira.springframework.org/browse/SPR-5470, which has been fixed in 3.0, but not in 2.5.x. Other runtime exceptions are imaginable as well. This issue is fairly reproducible with an embedded ActiveMQ broker which is shut down at the same time as the listener (may cause JMSExceptions in the listener).
To fix this issue, I suggest to use a finally block in order to decrement the active invoker count, and perform other clean up as necessary.
Dennis Homann opened SPR-7511 and commented
DefaultMessageListenerContainer does not reliably manage its activeInvokerCount, which may prevent it from shutting down. Instead, it will wait indefinitely in
In org.springframework.jms.listener.DefaultMessageListenerContainer.AsyncMessageListenerInvoker#run, #decreateActiveInvokerCount will never be called, if an exception is thrown from within the catch(Throwable ex) block, lines 886-908.
In the case at hand, a NPE is caused by https://jira.springframework.org/browse/SPR-5470, which has been fixed in 3.0, but not in 2.5.x. Other runtime exceptions are imaginable as well. This issue is fairly reproducible with an embedded ActiveMQ broker which is shut down at the same time as the listener (may cause JMSExceptions in the listener).
To fix this issue, I suggest to use a finally block in order to decrement the active invoker count, and perform other clean up as necessary.
Affects: 2.5.6
Referenced from: commits d7e0776
The text was updated successfully, but these errors were encountered: