You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ychawla <pr...@yahoo.com> on 2012/03/02 23:23:16 UTC
Re: Propogate CXF Exception to Camel
Hi Willem,
I upgraded to Camel 2.8.4 and CXF 2.4.6 and I still see this behavior. Here
is my route. It basically reads from a folder and calls a web service:
<endpoint id="foobarWebserviceEndpoint"
uri="cxf:bean:foobarRelocationService?dataFormat=PAYLOAD&loggingFeatureEnabled=true"
/>
<camel:route id="foobarRelocationHandlerConnector"
errorHandlerRef="foobarRelocationDeadLetterErrorHandler">
<camel:from uri="foobarRelocationInputDir" />
<camel:log message="Received file for foobar Relocations: ${file:name}"
/>
<camel:setHeader headerName="operationName">
<constant>opName</constant>
</camel:setHeader>
<camel:setHeader headerName="operationNamespace">
<constant>http://www.namespace.com/</constant>
</camel:setHeader>
<camel:to uri="foobarWebserviceEndpoint" />
<camel:log message="Called foobar intermediary" />
</camel:route>
</camel:camelContext>
<bean id="foobarRelocationDeadLetterErrorHandler"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="deadLetterUri" value="foobarRelocationDeadLetterDir" />
<property name="redeliveryPolicy"
ref="foobarRelocationRedeliveryPolicyConfig" />
</bean>
<bean id="foobarRelocationRedeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="3" />
<property name="redeliveryDelay" value="5000" />
</bean>
I get a connection refused error when I shut down the server:
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.interceptor.BareOutInterceptor@4320d68d
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@5538615e
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.ws.addressing.soap.MAPCodec@465e34ce
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.interceptor.StaxOutInterceptor@5123ac44
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.interceptor.AttachmentOutInterceptor@674a93a6
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.interceptor.LoggingOutInterceptor@491f03e4
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.interceptor.MessageSenderInterceptor@1338933d
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor@20e5e569
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7d02cdf9
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.ws.addressing.MAPAggregator@5c04e904
[rna/relocation/connector/input] PhaseInterceptorChain DEBUG
Invoking handleFault on interceptor
org.apache.cxf.ws.policy.PolicyOutInterceptor@7f1ef3e7
[rna/relocation/connector/input] PhaseInterceptorChain WARN
Interceptor for
{http://www.XXX.com}FOOBAR-Relocation#{http://www.XXX.com/1.0.0}SubmitFOOBARPackage
has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused
by: com.ctc.wstx.exc.WstxIOException: Connection refused.
at
org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:91)[cxf-rt-core-2.4.6.jar:2.4.6]
at
org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)[cxf-rt-core-2.4.6.jar:2.4.6]
at
org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:101)[camel-cxf-2.8.4.jar:2.8.4]
After this the route continues rather than trying redelivery. If I throw an
exception processor in there:
<camel:to uri="bean:throwit"/>
<bean id="throwit" class="org.search.processor.Process"/>
Then I see the redelivery attempts happen. This does not happen with the
web service 'connection refused' though...
Any ideas?
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5532402.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Propogate CXF Exception to Camel
Posted by Willem <wi...@gmail.com>.
Can I have a look at your cxf:bean configuration?
CxfProducer should be able to throw the exception out.
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
On Mar 3, 2012, at 6:23 AM, ychawla wrote:
> Hi Willem,
> I upgraded to Camel 2.8.4 and CXF 2.4.6 and I still see this behavior. Here
> is my route. It basically reads from a folder and calls a web service:
>
> <endpoint id="foobarWebserviceEndpoint"
>
> uri="cxf:bean:foobarRelocationService?dataFormat=PAYLOAD&loggingFeatureEnabled=true"
> />
>
>
> <camel:route id="foobarRelocationHandlerConnector"
> errorHandlerRef="foobarRelocationDeadLetterErrorHandler">
> <camel:from uri="foobarRelocationInputDir" />
> <camel:log message="Received file for foobar Relocations: ${file:name}"
> />
> <camel:setHeader headerName="operationName">
> <constant>opName</constant>
> </camel:setHeader>
> <camel:setHeader headerName="operationNamespace">
> <constant>http://www.namespace.com/</constant>
> </camel:setHeader>
> <camel:to uri="foobarWebserviceEndpoint" />
> <camel:log message="Called foobar intermediary" />
> </camel:route>
>
> </camel:camelContext>
>
>
> <bean id="foobarRelocationDeadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
>
> <property name="deadLetterUri" value="foobarRelocationDeadLetterDir" />
>
> <property name="redeliveryPolicy"
> ref="foobarRelocationRedeliveryPolicyConfig" />
> </bean>
>
>
> <bean id="foobarRelocationRedeliveryPolicyConfig"
> class="org.apache.camel.processor.RedeliveryPolicy">
>
> <property name="maximumRedeliveries" value="3" />
>
> <property name="redeliveryDelay" value="5000" />
> </bean>
>
> I get a connection refused error when I shut down the server:
>
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.BareOutInterceptor@4320d68d
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@5538615e
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.soap.MAPCodec@465e34ce
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.StaxOutInterceptor@5123ac44
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.AttachmentOutInterceptor@674a93a6
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.LoggingOutInterceptor@491f03e4
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.MessageSenderInterceptor@1338933d
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor@20e5e569
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7d02cdf9
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.MAPAggregator@5c04e904
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.policy.PolicyOutInterceptor@7f1ef3e7
> [rna/relocation/connector/input] PhaseInterceptorChain WARN
> Interceptor for
> {http://www.XXX.com}FOOBAR-Relocation#{http://www.XXX.com/1.0.0}SubmitFOOBARPackage
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused
> by: com.ctc.wstx.exc.WstxIOException: Connection refused.
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:91)[cxf-rt-core-2.4.6.jar:2.4.6]
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)[cxf-rt-core-2.4.6.jar:2.4.6]
> at
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:101)[camel-cxf-2.8.4.jar:2.8.4]
>
> After this the route continues rather than trying redelivery. If I throw an
> exception processor in there:
>
> <camel:to uri="bean:throwit"/>
>
> <bean id="throwit" class="org.search.processor.Process"/>
>
> Then I see the redelivery attempts happen. This does not happen with the
> web service 'connection refused' though...
>
> Any ideas?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5532402.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Propogate CXF Exception to Camel
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi guys,
maybe it doesn't help, but I used two routes like this:
from cxf -> to jms
from jms -> to cxf
and to "transport" the exception from the "to cxf" to the "from cxf", I
added the transferException=true on the two JMS endpoints.
Regards
JB
On 03/08/2012 08:32 AM, Willem Jiang wrote:
> Hi Yogesh,
>
> What kind of custom interceptor are you using?
>
> By adding the synchronous=true parameter, camel-cxf will not use the
> async invocation which is used by default to invoke the server.
>
>
>
> On 3/7/12 10:58 PM, ychawla wrote:
>> Hi Aki,
>> I do have a one-way service. I added the 'synchronous=true' to the
>> endpoint
>> and now it is throwing the error without using my custom interceptor.
>> Will
>> setting this attribute affect other behavior of the one-way service?
>>
>> Thanks,
>> Yogesh
>>
>> --
>> View this message in context:
>> http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
>>
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
--
Jean-Baptiste Onofré
jbonofre@apache.org
http://blog.nanthrax.net
Talend - http://www.talend.com
Re: Propogate CXF Exception to Camel
Posted by Willem Jiang <wi...@gmail.com>.
Hi Yogesh,
What kind of custom interceptor are you using?
By adding the synchronous=true parameter, camel-cxf will not use the
async invocation which is used by default to invoke the server.
On 3/7/12 10:58 PM, ychawla wrote:
> Hi Aki,
> I do have a one-way service. I added the 'synchronous=true' to the endpoint
> and now it is throwing the error without using my custom interceptor. Will
> setting this attribute affect other behavior of the one-way service?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang
Re: Propogate CXF Exception to Camel
Posted by Aki Yoshida <el...@googlemail.com>.
Hi Yogesh,
This property will affect the invocation behavior at the camel-cxf
boundary. In other words, in this case, the call occurs synchronously
across this boundary.
That could be considered inefficient in some scenarios (e.g., if you
are not interested in any errors and you want to just quickly dispatch
those oneway calls).
But in any case, this property only affects the behavior at the
camel-cxf or cxf-camel boundary. And it will not affect the way how
the remote oneway web service is executed. That part depends on how
you configured that remote oneway web service.
regards, aki
2012/3/7 ychawla <pr...@yahoo.com>:
> Hi Aki,
> I do have a one-way service. I added the 'synchronous=true' to the endpoint
> and now it is throwing the error without using my custom interceptor. Will
> setting this attribute affect other behavior of the one-way service?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Propogate CXF Exception to Camel
Posted by ychawla <pr...@yahoo.com>.
Hi Aki,
I do have a one-way service. I added the 'synchronous=true' to the endpoint
and now it is throwing the error without using my custom interceptor. Will
setting this attribute affect other behavior of the one-way service?
Thanks,
Yogesh
--
View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5544347.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Propogate CXF Exception to Camel
Posted by Aki Yoshida <el...@googlemail.com>.
Hi Yogesh,
could it be that your web service call is a oneway operation? If that
is the case, you should set the synchronous property to true
(...&synchronous=true) for the camel-cxf endpoint to get the
transmission error. See http://camel.apache.org/cxf.html for more
info. Can you try setting this property?
regards, aki
2012/3/2 ychawla <pr...@yahoo.com>:
> Hi Willem,
> I upgraded to Camel 2.8.4 and CXF 2.4.6 and I still see this behavior. Here
> is my route. It basically reads from a folder and calls a web service:
>
> <endpoint id="foobarWebserviceEndpoint"
>
> uri="cxf:bean:foobarRelocationService?dataFormat=PAYLOAD&loggingFeatureEnabled=true"
> />
>
>
> <camel:route id="foobarRelocationHandlerConnector"
> errorHandlerRef="foobarRelocationDeadLetterErrorHandler">
> <camel:from uri="foobarRelocationInputDir" />
> <camel:log message="Received file for foobar Relocations: ${file:name}"
> />
> <camel:setHeader headerName="operationName">
> <constant>opName</constant>
> </camel:setHeader>
> <camel:setHeader headerName="operationNamespace">
> <constant>http://www.namespace.com/</constant>
> </camel:setHeader>
> <camel:to uri="foobarWebserviceEndpoint" />
> <camel:log message="Called foobar intermediary" />
> </camel:route>
>
> </camel:camelContext>
>
>
> <bean id="foobarRelocationDeadLetterErrorHandler"
> class="org.apache.camel.builder.DeadLetterChannelBuilder">
>
> <property name="deadLetterUri" value="foobarRelocationDeadLetterDir" />
>
> <property name="redeliveryPolicy"
> ref="foobarRelocationRedeliveryPolicyConfig" />
> </bean>
>
>
> <bean id="foobarRelocationRedeliveryPolicyConfig"
> class="org.apache.camel.processor.RedeliveryPolicy">
>
> <property name="maximumRedeliveries" value="3" />
>
> <property name="redeliveryDelay" value="5000" />
> </bean>
>
> I get a connection refused error when I shut down the server:
>
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.BareOutInterceptor@4320d68d
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor@5538615e
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.soap.MAPCodec@465e34ce
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.StaxOutInterceptor@5123ac44
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.AttachmentOutInterceptor@674a93a6
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.LoggingOutInterceptor@491f03e4
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.interceptor.MessageSenderInterceptor@1338933d
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapPreProtocolOutInterceptor@20e5e569
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.binding.soap.interceptor.SoapHeaderOutFilterInterceptor@7d02cdf9
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.addressing.MAPAggregator@5c04e904
> [rna/relocation/connector/input] PhaseInterceptorChain DEBUG
> Invoking handleFault on interceptor
> org.apache.cxf.ws.policy.PolicyOutInterceptor@7f1ef3e7
> [rna/relocation/connector/input] PhaseInterceptorChain WARN
> Interceptor for
> {http://www.XXX.com}FOOBAR-Relocation#{http://www.XXX.com/1.0.0}SubmitFOOBARPackage
> has thrown exception, unwinding now
> org.apache.cxf.interceptor.Fault: Could not generate the XML stream caused
> by: com.ctc.wstx.exc.WstxIOException: Connection refused.
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:91)[cxf-rt-core-2.4.6.jar:2.4.6]
> at
> org.apache.cxf.databinding.source.XMLStreamDataWriter.write(XMLStreamDataWriter.java:50)[cxf-rt-core-2.4.6.jar:2.4.6]
> at
> org.apache.camel.component.cxf.HybridSourceDataBinding$1.write(HybridSourceDataBinding.java:101)[camel-cxf-2.8.4.jar:2.8.4]
>
> After this the route continues rather than trying redelivery. If I throw an
> exception processor in there:
>
> <camel:to uri="bean:throwit"/>
>
> <bean id="throwit" class="org.search.processor.Process"/>
>
> Then I see the redelivery attempts happen. This does not happen with the
> web service 'connection refused' though...
>
> Any ideas?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5532402.html
> Sent from the Camel - Users mailing list archive at Nabble.com.