camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rafal Janik <rafal.ja...@softwaremind.pl>
Subject Problem with inputStream and camel-activemq
Date Tue, 02 Nov 2010 14:23:19 GMT
Hi,


I'm trying to start activemq flow in camel:


<camelContext xmlns="http://camel.apache.org/schema/spring">


<route id="uploadFileJMS">

<from
                 
uri="activemq:queue:uploaded.files?jmsMessageType=Object&amp;testConnectionOnStartup=true"

/>

<log message="flow started"/>

<transacted />

<to uri="bean:myBean?method=testMethod" />

</route>


</camelContext>

The flow is started In Java DSL:

     private static final String URI = 
"activemq:queue:uploaded.files?exchangePattern=InOut";
     private ProducerTemplate template;

     ...

         public String start(InputStream is){
         CamelContext camel = new DefaultCamelContext();
         camel.addComponent("activemq", 
ActiveMQComponent.activeMQComponent("vm://localhost?broker.persistent=false"));
         template = camel.createProducerTemplate();
         try {
             camel.start();
         } catch (Exception e) {
             e.printStackTrace();
         }

         try {
             log.info("Stream availability: " + is.available());
         } catch (IOException e) {
             e.printStackTrace();  //To change body of catch statement 
use File | Settings | File Templates.
         }
         String response = (String)template.requestBody(URI,is);

         return "response";
     }


if the line
      String response = (String)template.requestBody(URI,is);
is replaced with (stream is replaced with String)
      String response = (String)template.requestBody(URI,"some string");

everything  works fine.






if not exception is thrown:

  2010-11-02 15:17:06,108 | WARN  | PhaseInterceptorChain            | 
Application 
{http://services.common.layer.composition.weknowit.eu/}UploadCamelService has 
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: java.lang.NullPointerException
         at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         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 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
         at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
         at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
         at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NullPointerException
         at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:118)
         at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:106)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
         at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:271)
         at 
eu.weknowit.composition.layer.common.services.UploadCamelService.uploadFile(UploadCamelService.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
         ... 24 more
Caused by: java.lang.NullPointerException
         at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
         at 
org.apache.activemq.command.ActiveMQBytesMessage.writeBytes(ActiveMQBytesMessage.java:687)
         at 
org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)
         at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:277)
         at 
org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:197)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:221)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:164)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:178)
         at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:175)
         at 
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:369)
         at 
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:211)
         at 
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161)
         at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
         at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:116)
         ... 35 more
2010-11-02 15:17:06,109 | WARN  | PhaseInterceptorChain            | 
Application 
{http://services.common.layer.composition.weknowit.eu/}UploadCamelService has 
thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: java.lang.NullPointerException
         at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         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 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
         at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
         at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
         at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NullPointerException
         at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:118)
         at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:106)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
         at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:271)
         at 
eu.weknowit.composition.layer.common.services.UploadCamelService.uploadFile(UploadCamelService.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
         ... 24 more
Caused by: java.lang.NullPointerException
         at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
         at 
org.apache.activemq.command.ActiveMQBytesMessage.writeBytes(ActiveMQBytesMessage.java:687)
         at 
org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)
         at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:277)
         at 
org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:197)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:221)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:164)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:178)
         at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:175)
         at 
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:369)
         at 
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:211)
         at 
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161)
         at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
         at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:116)
         ... 35 more
2010-11-02 15:17:06,110 | WARN  | PhaseInterceptorChain            | 
Exception in handleFault on interceptor 
org.apache.cxf.binding.xml.interceptor.XMLFaultOutInterceptor@e585d4
org.apache.cxf.interceptor.Fault: java.lang.NullPointerException
         at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         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 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
         at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
         at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
         at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NullPointerException
         at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:118)
         at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:106)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
         at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:271)
         at 
eu.weknowit.composition.layer.common.services.UploadCamelService.uploadFile(UploadCamelService.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
         ... 24 more
Caused by: java.lang.NullPointerException
         at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
         at 
org.apache.activemq.command.ActiveMQBytesMessage.writeBytes(ActiveMQBytesMessage.java:687)
         at 
org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)
         at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:277)
         at 
org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:197)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:221)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:164)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:178)
         at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:175)
         at 
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:369)
         at 
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:211)
         at 
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161)
         at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
         at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:116)
         ... 35 more
2010-11-02 15:17:06,110 | ERROR | tractFaultChainInitiatorObserver | 
Error occurred during error handling, give up!
org.apache.cxf.interceptor.Fault: java.lang.NullPointerException
         at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         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 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
         at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
         at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
         at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NullPointerException
         at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:118)
         at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:106)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
         at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:271)
         at 
eu.weknowit.composition.layer.common.services.UploadCamelService.uploadFile(UploadCamelService.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
         ... 24 more
Caused by: java.lang.NullPointerException
         at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
         at 
org.apache.activemq.command.ActiveMQBytesMessage.writeBytes(ActiveMQBytesMessage.java:687)
         at 
org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)
         at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:277)
         at 
org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:197)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:221)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:164)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:178)
         at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:175)
         at 
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:369)
         at 
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:211)
         at 
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161)
         at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
         at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:116)
         ... 35 more
2010-11-02 15:17:06,111 | WARN  | jetty                            | 
/cl/uploadCamelService/uploadFile/1234
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault: 
java.lang.NullPointerException
         at 
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:99)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:292)
         at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:109)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:312)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:276)
         at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:70)
         at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
         at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230)
         at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
         at org.mortbay.jetty.Server.handle(Server.java:326)
         at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
         at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:938)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:755)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
         at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
         at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
Caused by: org.apache.cxf.interceptor.Fault: java.lang.NullPointerException
         at 
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:155)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:121)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:133)
         at org.apache.cxf.jaxrs.JAXRSInvoker.invoke(JAXRSInvoker.java:82)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:58)
         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 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)
         at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:106)
         at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:243)
         ... 15 more
Caused by: org.apache.camel.RuntimeCamelException: 
java.lang.NullPointerException
         at 
org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:118)
         at 
org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:102)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:106)
         at 
org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
         at 
org.apache.camel.impl.DefaultProducerTemplate.requestBody(DefaultProducerTemplate.java:271)
         at 
eu.weknowit.composition.layer.common.services.UploadCamelService.uploadFile(UploadCamelService.java:57)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:173)
         at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:89)
         ... 24 more
Caused by: java.lang.NullPointerException
         at java.io.FilterOutputStream.write(FilterOutputStream.java:80)
         at 
org.apache.activemq.command.ActiveMQBytesMessage.writeBytes(ActiveMQBytesMessage.java:687)
         at 
org.apache.camel.component.jms.JmsBinding.createJmsMessage(JmsBinding.java:470)
         at 
org.apache.camel.component.jms.JmsBinding.makeJmsMessage(JmsBinding.java:277)
         at 
org.apache.camel.component.jms.JmsProducer$1.createMessage(JmsProducer.java:197)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.doSendToDestination(JmsConfiguration.java:221)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.access$100(JmsConfiguration.java:164)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate$1.doInJms(JmsConfiguration.java:178)
         at 
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:471)
         at 
org.apache.camel.component.jms.JmsConfiguration$CamelJmsTemplate.send(JmsConfiguration.java:175)
         at 
org.apache.camel.component.jms.JmsProducer.doSend(JmsProducer.java:369)
         at 
org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:211)
         at 
org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:179)
         at 
org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:161)
         at 
org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:146)
         at 
org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:160)
         at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:116)



camel-core (2.2.0)
activemq-camel (5.3.0)


Regards,

rafal



Mime
View raw message