Hi

The escaped exception can indeed be handled by CXF fault interceptors, but also by JAX-RS ExceptionMapper, and on the client side, by ResponseExceptionMapper.

I'm not sure why onException is not triggered (you said below that it actually goes into onException but the subject implies otherwise).

May be the escaped exceptions should be set on the Camel exchange inside CXFRS. I'll investigate when I get a chance to work on Camel more.

Sergey
On 23/02/16 10:02, M.Ismail wrote:
Hi,

I'm using Camel 2.12.0 in OSGI container. I am using cxfrs as a consumer but
I can't handle javax.xml.stream.XMLStreamException which is thrown by cxfrs
in case failure to parse the request.

If I throw the exception  XMLStreamException  it goes to onException though.
I read that cxf can use fault interceptors. Should I create a fault
interceptor and forget about handling XMLStreamException using onException?
Please, advise.

<camelContext id="camel"
                xmlns="http://camel.apache.org/schema/blueprint"; 
autoStartup="true"
                trace="false">


                <onException>
                        
<exception>javax.xml.stream.XMLStreamException</exception>

                        <handled>
                                <constant>true</constant>
                        </handled>
                        <log message="\n\n******** Inside exception handler  
*******\n\n"/>
                        <transform>
                                <constant>{ "message":"failure" }
                                </constant>
                        </transform>

                </onException>


                <route id="notification_prod" streamCache="true">
                        <from
                        
uri="cxfrs://bean://rsNotificationServer?headerFilterStrategy=#dropAllMessageHeadersStrategy&amp;bindingStyle=SimpleConsumer&amp;throwExceptionOnFailure=false&amp;loggingFeatureEnabled=true&amp;httpClientAPI=true"
/>

                        <to uri="log:body?level=INFO" />
                        <setHeader headerName="Accept">
                                <constant>application/json</constant>
                        </setHeader>
                        <to
                        
uri="bean:notifyUtil?method=getNotifyIndividualResponse&amp;synchronous=true"
/>
                        <removeHeaders pattern="Content-Length*" />
                      </route>
</camelContext>



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-handle-CXFRS-exception-using-onException-tp5778104.html
Sent from the Camel - Users mailing list archive at Nabble.com.



--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Reply via email to