Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
2.14.1
-
None
-
Unknown
Description
DefaultCamelContext uses LRUSoftCache for endpoints cache. LRUSoftCache store values as SoftReference which can be reclaimed by GC. DefaultCamelContext.removeEndpoints() does not take into account this fact. This sometimes leads to java.lang.NullPointerException.
We are still tied to 2.14.x Camel, because of our target environment is IBM enterprise product running under IBM WAS / IBM JDK 1.6. But seems like this affects all latest Camel releases. Here is an example of error stack trace I observe from time to time...
0 java.lang.NullPointerException: null 1 at org.apache.camel.impl.DefaultCamelContext.removeEndpoints(DefaultCamelContext.java:465) ~[camel-core-2.14.1.jar:2.14.1] 2 at com.amrusoft.easimport.biscc.BisccDocumentImporterBean.execute(BisccDocumentImporterBean.java:196) ~[adapter-biscc-1.4.0.jar:na] 3 at sun.reflect.GeneratedMethodAccessor600.invoke(Unknown Source) ~[na:na] 4 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0] 5 at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0] 6 at org.apache.camel.component.bean.MethodInfo.invoke(MethodInfo.java:408) ~[camel-core-2.14.1.jar:2.14.1] 7 at org.apache.camel.component.bean.MethodInfo$1.doProceed(MethodInfo.java:279) ~[camel-core-2.14.1.jar:2.14.1] 8 at org.apache.camel.component.bean.MethodInfo$1.proceed(MethodInfo.java:252) ~[camel-core-2.14.1.jar:2.14.1] 9 at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:167) ~[camel-core-2.14.1.jar:2.14.1] 10 at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105) [camel-core-2.14.1.jar:2.14.1] 11 at org.apache.camel.component.bean.BeanProcessor.process(BeanProcessor.java:67) ~[camel-core-2.14.1.jar:2.14.1] 12 at org.apache.camel.impl.ProcessorEndpoint.onExchange(ProcessorEndpoint.java:103) ~[camel-core-2.14.1.jar:2.14.1] 13 at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71) ~[camel-core-2.14.1.jar:2.14.1] 14 at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61) ~[camel-core-2.14.1.jar:2.14.1] 15 at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120) ~[camel-core-2.14.1.jar:2.14.1] 16 at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) [camel-core-2.14.1.jar:2.14.1] 17 at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416) [camel-core-2.14.1.jar:2.14.1] 18 at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) [camel-core-2.14.1.jar:2.14.1] 19 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) [camel-core-2.14.1.jar:2.14.1] 20 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.14.1.jar:2.14.1] 21 at org.apache.camel.processor.idempotent.IdempotentConsumer.process(IdempotentConsumer.java:125) [camel-core-2.14.1.jar:2.14.1] 22 at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72) [camel-core-2.14.1.jar:2.14.1] 23 at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416) [camel-core-2.14.1.jar:2.14.1] 24 at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191) [camel-core-2.14.1.jar:2.14.1] 25 at org.apache.camel.processor.Pipeline.process(Pipeline.java:118) [camel-core-2.14.1.jar:2.14.1] 26 at org.apache.camel.processor.Pipeline.process(Pipeline.java:80) [camel-core-2.14.1.jar:2.14.1] 27 at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105) [camel-core-2.14.1.jar:2.14.1] 28 at org.apache.camel.processor.Pipeline.process(Pipeline.java:60) [camel-core-2.14.1.jar:2.14.1] 29 at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:166) [camel-core-2.14.1.jar:2.14.1] 30 at org.apache.camel.component.file.GenericFileConsumer.processExchange(GenericFileConsumer.java:433) [camel-core-2.14.1.jar:2.14.1] 31 at org.apache.camel.component.file.remote.RemoteFileConsumer.processExchange(RemoteFileConsumer.java:99) [camel-ftp-2.14.1.jar:2.14.1] 32 at org.apache.camel.component.file.GenericFileConsumer.processBatch(GenericFileConsumer.java:211) [camel-core-2.14.1.jar:2.14.1] 33 at org.apache.camel.component.file.GenericFileConsumer.poll(GenericFileConsumer.java:175) [camel-core-2.14.1.jar:2.14.1] 34 at org.apache.camel.impl.ScheduledPollConsumer.doRun(ScheduledPollConsumer.java:187) [camel-core-2.14.1.jar:2.14.1] 35 at org.apache.camel.impl.ScheduledPollConsumer.run(ScheduledPollConsumer.java:114) [camel-core-2.14.1.jar:2.14.1] 36 at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:53) [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE] 37 at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81) [spring-context-3.2.11.RELEASE.jar:3.2.11.RELEASE] 38 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:450) [na:1.6.0] 39 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314) [na:1.6.0] 40 at java.util.concurrent.FutureTask.run(FutureTask.java:149) [na:1.6.0] 41 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:109) [na:1.6.0] 42 at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:217) [na:1.6.0] 43 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:908) [na:1.6.0] 44 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:931) [na:1.6.0] 45 at java.lang.Thread.run(Thread.java:773) [na:1.6.0]