This is I'm not sure about - perhaps a current Camel message/exchange can be accessed via a thread local storage and the exception set there ?

Cheers, Sergey
On 24/02/16 16:08, M.Ismail wrote:
Hi,

I have found that I the exception is escaped and in order to handle it i had
to create a CXF ExceptionMapper as per the below. Is this a normal behavior?
Can I re-throw the exception handled by the ExceptionMapper so that Camel
can handle it?


public class MyExceptionMapper implements
ExceptionMapper<javax.ws.rs.BadRequestException> {

        @Override
        public Response toResponse(javax.ws.rs.BadRequestException exception) {
                // TODO Auto-generated method stub
                
                return Response.status(Response.Status.BAD_REQUEST).build();
        }
        
}

<cxf:rsServer id="rsNotificationServer"
                address="http://0.0.0.0:${proxy.port}${sematiService}";
serviceClass="com.huawei.zain.ksa.notification.CXFNotificationServiceImpl"
                loggingFeatureEnabled="true" loggingSizeLimit="20">
                <cxf:providers>
                        <ref component-id="jsonProvider" />

                        <bean id="MyExceptionMapper"
class="com.huawei.zain.ksa.notification.MyExceptionMapper"/>
                </cxf:providers>
        </cxf:rsServer>



--
View this message in context: 
http://camel.465427.n5.nabble.com/Unable-to-handle-CXFRS-exception-using-onException-tp5778104p5778217.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