camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Propogate CXF Exception to Camel
Date Fri, 17 Feb 2012 02:13:06 GMT
CXF should be able to throw the ConnectException out in current trunk.
Which version of Camel are you using ?

Willem
On Fri Feb 17 10:02:11 2012, ychawla wrote:
> Hello All,
> I got Camel to see the exception by throwing a fault in my interceptor.
> This is probably not the preferred way to do this, but it seemed to work:
>
> public class CamelExceptionInterceptor extends
> AbstractPhaseInterceptor<Message>  {
>
> 	public CamelExceptionInterceptor() {
> 		super(Phase.SETUP);
> 	}
>
>      @Override
>      public void handleFault(Message message)
>      {
>              Exception exception = message.getContent(Exception.class);
>              throw new Fault(exception);
>
>      }
>
> 	@Override
> 	public void handleMessage(Message message) throws Fault {
> 	}
> }
>
> I then wired this interceptor into my Camel route.  I had to hunt a while to
> see what phase it was bombing out on, but this worked:
>
>    <cxf:cxfEndpoint
>      id="myService"
>      address="http://localhost/service"
>      wsdlURL="service.wsdl"
>      serviceName="test:ServiceService"
>      endpointName="test:Service"
>      xmlns:test="http://test.com"
>      >
>      <cxf:outInterceptors>
>      	<ref bean="camelExceptionInterceptor"/>
>      </cxf:outInterceptors>
>    </cxf:cxfEndpoint>
>
> Maybe this fault did not propogate because in my test scenario, a connection
> could not be established so it wasn't far enough in the CXF chain to
> propogate the exception?
>
> Thanks,
> Yogesh
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Propogate-CXF-Exception-to-Camel-tp5491102p5491265.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 


Mime
View raw message