Improper Handling of Spring NullPointerException
Issue
- Spring throws an NPE, which is not being properly handled. The end-result is that the attempts to refresh the JMS connections by the Camel route continue until the Fuse container is stopped. This is reflected in the many ERROR statements, such as the one below, found in the container’s log files.
2015-01-22 08:40:02,117 | ERROR | Camel (CP_EPICadOTTR2_ip) thread #95 - JmsConsumer[vt.CP.ip.EPICad.in.CP_EPICadOTTR2_ip] | org.apache.camel.component.jms.DefaultJmsMessageListenerContainer} | 128 - org.apache.servicemix.bundles.spring-jms - 3.2.9.RELEASE_1 | Could not refresh JMS Connection for destination 'vt.CP.ip.EPICad.in.CP_EPICadOTTR2_ip?consumer.exclusive=true' - retrying in 5000 ms. Cause: null
java.lang.NullPointerException
at org.springframework.jms.listener.AbstractJmsListeningContainer.refreshSharedConnection(AbstractJmsListeningContainer.java:392)[128:org.apache.servicemix.bundles.spring-jms:3.2.9.RELEASE_1]
at org.springframework.jms.listener.DefaultMessageListenerContainer.refreshConnectionUntilSuccessful(DefaultMessageListenerContainer.java:885)[128:org.apache.servicemix.bundles.spring-jms:3.2.9.RELEASE_1]
at org.springframework.jms.listener.DefaultMessageListenerContainer.recoverAfterListenerSetupFailure(DefaultMessageListenerContainer.java:861)[128:org.apache.servicemix.bundles.spring-jms:3.2.9.RELEASE_1]
at org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:1012)[128:org.apache.servicemix.bundles.spring-jms:3.2.9.RELEASE_1]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_60]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_60]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_60]
Environment
- Red Hat JBoss Fuse
- 6.2
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
