Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Done
-
None
-
None
Description
The following NullPointerException can be seen in the logs when A Camel JMS route is stopped:
8:04:19,257 INFO [impl.DefaultShutdownStrategy] Route: SimpleCamelService-[jms://TestQueue?connectionFactory=#ConnectionFactory] suspended and shutdown deferred, was consuming from: Endpoint[jms://TestQueue?connectionFactory=%23ConnectionFactory] 08:04:19,258 WARN [impl.DefaultShutdownStrategy] Error occurred while shutting down route: Consumer[jms://TestQueue?connectionFactory=%23ConnectionFactory]. This exception will be ignored. java.lang.NullPointerException at org.apache.camel.component.jms.JmsConsumer.doStop(JmsConsumer.java:130) at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:98) at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:122) at org.apache.camel.util.ServiceHelper.stopService(ServiceHelper.java:108) at org.apache.camel.impl.DefaultShutdownStrategy.shutdownNow(DefaultShutdownStrategy.java:248) at org.apache.camel.impl.DefaultShutdownStrategy$ShutdownTask.run(DefaultShutdownStrategy.java:475) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441) at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) at java.util.concurrent.FutureTask.run(FutureTask.java:138) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:680) 08:04:19,258 INFO [impl.DefaultShutdownStrategy] Route: SimpleCamelService-[jms://TestQueue?connectionFactory=#ConnectionFactory] shutdown complete. 08:04:19,259 INFO [impl.DefaultShutdownStrategy] Graceful shutdown of 1 routes completed in 0 seconds
By stepping through this it seems like Camel is trying to stop the route twice, once which is triggered by SwitchYard's InboundHandler and a second time by Camel. The second call is what is producing this NPE.