camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aki Yoshida <elak...@gmail.com>
Subject Re: NullPointerException in FileInputStreamCache
Date Thu, 13 Feb 2014 09:12:11 GMT
it looks life the stream has been closed and thus destroyed but it was re-used.

For the dev community, I think camel's CachedOutputStream is hard to
use as it targets for a single owner usage compared to cxf's one which
does reference counting for opened connections to support multiple
threads reading from the stream. Maybe we should consider creating a
common one to be used by both projects and later putting it into
commons-ii or somewhere?

regards, aki

2014-02-13 5:03 GMT+01:00 Rural Hunter <ruralhunter@gmail.com>:
> Hi,
>
> I'm using Camel 2.12.2 and enabled stream caching with this code:
> context.setStreamCaching(true);
>
> Sometimes I got NullPointerException related to stream cache:
>
> Stacktrace
> ---------------------------------------------------------------------------------------------------------------------------------------
> java.lang.NullPointerException
>     at
> org.apache.camel.converter.stream.FileInputStreamCache.<init>(FileInputStreamCache.java:52)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.converter.stream.CachedOutputStream.newStreamCache(CachedOutputStream.java:199)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.MarshalProcessor.process(MarshalProcessor.java:79)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:398)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:118)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.Pipeline.process(Pipeline.java:80)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:105)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:87)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:103)[camel-jms-2.12.2.jar:2.12.2]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
>     at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]
> 2014-02-13 11:56:56 WARN Camel (camel-1) thread #0 -
> JmsConsumer[com.test.letter]
> org.apache.camel.component.jms.EndpointMessageListener - Execution of JMS
> message listener failed. Caused by: [org.apache.camel.RuntimeCamelException
> - java.lang.NullPointerException]
> org.apache.camel.RuntimeCamelException: java.lang.NullPointerException
>     at
> org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1352)[camel-core-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.component.jms.EndpointMessageListener$EndpointMessageListenerAsyncCallback.done(EndpointMessageListener.java:186)[camel-jms-2.12.2.jar:2.12.2]
>     at
> org.apache.camel.component.jms.EndpointMessageListener.onMessage(EndpointMessageListener.java:107)[camel-jms-2.12.2.jar:2.12.2]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:562)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:500)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:468)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:325)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:263)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:1103)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:1095)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:992)[spring-jms-3.2.4.RELEASE.jar:3.2.4.RELEASE]
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_51]
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_51]
>     at java.lang.Thread.run(Thread.java:744)[:1.7.0_51]

Mime
View raw message