camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Schneider (JIRA)" <j...@apache.org>
Subject [jira] Issue Comment Edited: (CAMEL-2129) Misleading exception when a Camel-CXF Service call times out (Null InputStream is not a valid argument)
Date Thu, 05 Nov 2009 08:28:53 GMT

    [ https://issues.apache.org/activemq/browse/CAMEL-2129?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=55170#action_55170
] 

Christian Schneider edited comment on CAMEL-2129 at 11/5/09 12:28 AM:
----------------------------------------------------------------------

Hi Willem,

could you change the two places where you throw the exception into:
  throw new IOException("Can't get the response message", ex);
instead of:
  throw new IOException("Can't get the response message. Caused by: " + ex);

and 

   throw new IOException("Can't get the response message", exchange.getException());
instead of 
   throw new IOException("Can't get the response message. Caused by " + exchange.getException());

This will forward the stack trace.

After this additional change when I simply start a cxf client that forwards its message to
camel jms I get the exception below. This still does not look correct. The root cause is a
nullpointer exception in SimpleMessageListenerContainer.doShutdown. The attributes consumers
and sessions are null. The implementation does not check this though. This results in the
throw ex not being executed:

if (ex != null) {

  stop(childrenStarted); <----- inside here we get the nullpointer ex

  throw ex; <---- So this exception is lost

}

As we can not directly fix this I think the way to fix the problem is catching this exception
in camel.impl.ServiceSupport.stop. A try catch that ignores all errors should do the trick.


org.apache.cxf.interceptor.Fault: Could not send Message.
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:301)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:121)
	at $Proxy61.getCustomersByName(Unknown Source)
	at com.example.customerservice.impl.CustomerServiceClient.main(CustomerServiceClient.java:45)
Caused by: java.io.IOException: Can't get the response message
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:186)
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.doClose(CamelConduit.java:155)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:177)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 8 more
Caused by: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for
endpoint: Endpoint[jms://queue:CustomerService]. Reason: java.lang.NullPointerException
	at org.apache.camel.component.jms.JmsProducer.testAndSetRequestor(JmsProducer.java:116)
	at org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:175)
	at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
	at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:81)
	at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:79)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:78)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
	at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:186)
	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:155)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88)
	at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148)
	at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
	at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:45)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:170)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:156)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141)
	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:155)
	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:111)
	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:101)
	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:88)
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:172)
	... 12 more
Caused by: java.lang.NullPointerException
	at org.springframework.jms.listener.SimpleMessageListenerContainer.doShutdown(SimpleMessageListenerContainer.java:304)
	at org.springframework.jms.listener.AbstractJmsListeningContainer.shutdown(AbstractJmsListeningContainer.java:211)
	at org.springframework.jms.listener.AbstractJmsListeningContainer.destroy(AbstractJmsListeningContainer.java:149)
	at org.apache.camel.component.jms.requestor.Requestor.doStop(Requestor.java:212)
	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:74)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:57)
	at org.apache.camel.component.jms.JmsProducer.testAndSetRequestor(JmsProducer.java:108)
	... 36 more


      was (Author: chris@die-schneider.net):
    Hi Willem,

could you change the two places where you throw the exception into:
  throw new IOException("Can't get the response message", ex);
instead of:
  throw new IOException("Can't get the response message. Caused by: " + ex);

and 

   throw new IOException("Can't get the response message", exchange.getException());
instead of 
   throw new IOException("Can't get the response message. Caused by " + exchange.getException());

This will forward the stack trace.

After this additional change when I simply start a cxf client that forwards its message to
camel jms I get the exception below. This still does not look correct. The root cause is a
nullpointer exception in SimpleMessageListenerContainer.doShutdown. The attributes consumers
and sessions are null. The implementation does not check this though. This results in the
throw ex not being executed:

if (ex != null) {
  stop(childrenStarted); <----- inside here we get the nullpointer ex
  throw ex; <---- So this exception is lost
}

As we can not directly fix this I think the way to fix the problem is catching this exception
in camel.impl.ServiceSupport.stop. A try catch that ignores all errors should do the trick.


org.apache.cxf.interceptor.Fault: Could not send Message.
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:64)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:471)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:301)
	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:253)
	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:121)
	at $Proxy61.getCustomersByName(Unknown Source)
	at com.example.customerservice.impl.CustomerServiceClient.main(CustomerServiceClient.java:45)
Caused by: java.io.IOException: Can't get the response message
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:186)
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.doClose(CamelConduit.java:155)
	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:177)
	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
	... 8 more
Caused by: org.apache.camel.FailedToCreateProducerException: Failed to create Producer for
endpoint: Endpoint[jms://queue:CustomerService]. Reason: java.lang.NullPointerException
	at org.apache.camel.component.jms.JmsProducer.testAndSetRequestor(JmsProducer.java:116)
	at org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:175)
	at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:147)
	at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:81)
	at org.apache.camel.processor.SendProcessor$1.doInProducer(SendProcessor.java:79)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141)
	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:78)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
	at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:61)
	at org.apache.camel.processor.RedeliveryErrorHandler.processExchange(RedeliveryErrorHandler.java:186)
	at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:155)
	at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:88)
	at org.apache.camel.processor.DefaultErrorHandler.process(DefaultErrorHandler.java:49)
	at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:148)
	at org.apache.camel.processor.UnitOfWorkProcessor.processNext(UnitOfWorkProcessor.java:54)
	at org.apache.camel.processor.DelegateProcessor.process(DelegateProcessor.java:48)
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:45)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:170)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:156)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:141)
	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:155)
	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:111)
	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:101)
	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:88)
	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:172)
	... 12 more
Caused by: java.lang.NullPointerException
	at org.springframework.jms.listener.SimpleMessageListenerContainer.doShutdown(SimpleMessageListenerContainer.java:304)
	at org.springframework.jms.listener.AbstractJmsListeningContainer.shutdown(AbstractJmsListeningContainer.java:211)
	at org.springframework.jms.listener.AbstractJmsListeningContainer.destroy(AbstractJmsListeningContainer.java:149)
	at org.apache.camel.component.jms.requestor.Requestor.doStop(Requestor.java:212)
	at org.apache.camel.impl.ServiceSupport.stop(ServiceSupport.java:74)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:57)
	at org.apache.camel.component.jms.JmsProducer.testAndSetRequestor(JmsProducer.java:108)
	... 36 more

  
> Misleading exception when a Camel-CXF Service call times out (Null InputStream is not
a valid argument)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2129
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2129
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.0.0
>            Reporter: Christian Schneider
>            Assignee: Willem Jiang
>             Fix For: 1.6.2, 2.1.0
>
>
> We use camel-cxf and camel-jms to offer CXF services over SOAP/JMS.
> When the client calls the service by using the generated stub code and a timeout occurs
I get an exception "Null InputStream is not a valid argument". I would rather expect something
like "Timeout calling service". Full stack trace is attached below.
> The routing config is attached below.
> <client id="customerService" xmlns="http://cxf.apache.org/jaxws"
> xmlns:service="http://examples.etg.services.enbw.net/"
>   serviceName="service:CustomerService"
>   endpointName="service:CustomerServiceEndpoint"
>   serviceClass="net.enbw.services.etg.examples.customerservice.CustomerServiceV1"
>   address="camel://direct:client">
> </client>
> <camelContext id="camelContext" trace="false" xmlns="http://camel.apache.org/schema/spring">
>   <route>
>     <from uri="direct:client"/>
>     <to uri="jms://queue.net.enbw.services.etg.examples.customerservice.CustomerService"
/>
>   </route>
> </camelContext>
> ------
> 03.11.2009 13:20:58 org.apache.cxf.phase.PhaseInterceptorChain doIntercept
> WARNUNG: Interceptor has thrown exception, unwinding now
> java.lang.IllegalArgumentException: Null InputStream is not a valid argument
> 	at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:614)
> 	at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324)
> 	at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:879)
> 	at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:83)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:664)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.handleResponse(CamelConduit.java:191)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:183)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.doClose(CamelConduit.java:153)
> 	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:185)
> 	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:478)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:260)
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> 	at $Proxy63.readCustomersByName(Unknown Source)
> 	at net.enbw.endur.AppModule.doBusiness(AppModule.java:34)
> 	at net.enbw.endur.AppMain.main(AppMain.java:23)
> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Null InputStream is
not a valid argument
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:146)
> 	at $Proxy63.readCustomersByName(Unknown Source)
> 	at net.enbw.endur.AppModule.doBusiness(AppModule.java:34)
> 	at net.enbw.endur.AppMain.main(AppMain.java:23)
> Caused by: java.lang.IllegalArgumentException: Null InputStream is not a valid argument
> 	at com.ctc.wstx.stax.WstxInputFactory.createSR(WstxInputFactory.java:614)
> 	at com.ctc.wstx.stax.WstxInputFactory.createXMLStreamReader(WstxInputFactory.java:324)
> 	at org.apache.cxf.staxutils.StaxUtils.createXMLStreamReader(StaxUtils.java:879)
> 	at org.apache.cxf.interceptor.StaxInInterceptor.handleMessage(StaxInInterceptor.java:83)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:664)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.handleResponse(CamelConduit.java:191)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.commitOutputMessage(CamelConduit.java:183)
> 	at org.apache.camel.component.cxf.transport.CamelConduit$CamelOutputStream.doClose(CamelConduit.java:153)
> 	at org.apache.cxf.io.CachedOutputStream.close(CachedOutputStream.java:185)
> 	at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:66)
> 	at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
> 	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:478)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:308)
> 	at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:260)
> 	at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:73)
> 	at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:124)
> 	... 3 more

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message