Hi  
Can you remove the first line of onException(Exception.class)?
As you set the handled(true) it will not triage any other exception handler.


--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Thursday, April 11, 2013 at 11:13 PM, shyenuganti wrote:

> Hi All,
>  
> I am not able to handle the soapFault properly. Here is my sample Camel code
> :  
>  
> onException(Exception.class).handled(true)
> .process(new Processor(){
> public void process(Exchange exchange) throws Exception {
> System.out.println("From Generic Exception Handler");
>  
> }
>  
> });
>  
>  
>  
>  
> from("quartz://JMSScheduler?cron=0/20+*+*+*+*+?").routeId("QuartzJMSTimer")
> .log("Timer says it's time to work")
> .to("direct:fromJmsQueue");
>  
> from("direct:fromJmsQueue")
> .routeId(ROUTE_NAME)
> .pollEnrich(FROM_EVENTQUEUE_JMS)
> .log("Event Message read from JMS queue : ${body}")
> .unmarshal(jaxb)
> .to("bean:policyServiceSOAPRequest?method=createPolicySOAPRequest")
> .log("Policy Service Request : ${body}")
> .processRef("headerProcessor")  
> .log("Sending Request")
> .to("direct:policyServiceRequest");
>  
> from("direct:policyServiceRequest")
>  
> .onException(SoapFault.class)
> .maximumRedeliveries(0).handled(true)
> .log("Handling SoapFault in the route ")
> .process(new Processor(){
>  
> @Override
> public void process(Exchange exchange) throws Exception {
> System.out.println("From SOAPFault Handler ... ");
> SoapFault faultex = exchange.getProperty(Exchange.EXCEPTION_CAUGHT,
> SoapFault.class);  
> logger.debug(faultex.getDetail().getTextContent());
> }
>  
> })
> .end()
>  
> .to(POLICY_WEBSERVICE_CALL)
> .convertBodyTo(PolicyResponse.class)
> .to("stream:out");
>  
> }
>  
>  
> This is throwing me the following error :  
>  
> 11:03:00,339 ERROR [QuartzEndpoint] Error processing exchange.
> Exchange[Message: [Body is null]]. Caused by:
> [org.quartz.JobExecutionException - org.apache.cxf.binding.soap.SoapFault:
> Account information cannot be found for policy number '8691885'.]
> 11:03:00,339 INFO [JobRunShell] Job DEFAULT.quartz-endpoint2 threw a
> JobExecutionException:  
> org.quartz.JobExecutionException: org.apache.cxf.binding.soap.SoapFault:
> Account information cannot be found for policy number '8691885'. [See nested
> exception: org.apache.cxf.binding.soap.SoapFault: Account information cannot
> be found for policy number '8691885'.]
> at
> org.apache.camel.component.quartz.QuartzEndpoint.onJobExecute(QuartzEndpoint.java:117)
> at org.apache.camel.component.quartz.CamelJob.execute(CamelJob.java:54)
> at org.quartz.core.JobRunShell.run(JobRunShell.java:216)
> at
> org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:549)
> Caused by: org.apache.cxf.binding.soap.SoapFault: Account information cannot
> be found for '8691885'.
> at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.unmarshalFault(Soap11FaultInInterceptor.java:75)
> at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:46)
> at
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:35)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> at
> org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:114)
> at
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:69)
> at
> org.apache.cxf.binding.soap.interceptor.CheckFaultInterceptor.handleMessage(CheckFaultInterceptor.java:34)
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:271)
> at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:782)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1590)
> at
> org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream$1.run(HTTPConduit.java:1121)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$3.run(AutomaticWorkQueueImpl.java:426)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at
> org.apache.cxf.workqueue.AutomaticWorkQueueImpl$AWQThreadFactory$1.run(AutomaticWorkQueueImpl.java:351)
> at java.lang.Thread.run(Thread.java:662)
>  
>  
> I am seeing the soapFault. But is wrapped inside a
> org.quartz.JobExecutionException. Why is that so?  
>  
> My quartz job is just to invoke the next route. Are all routes that follows
> the quartz component considered part of the quartz job ? In my case, what
> all routes are considered part of the quartz job? How can I handle soap
> Fault in my case ?  
>  
> I am not seeing any logs from the global exception as well? Am I doing
> something wrong here? Please help.
>  
> Sri Harsha Y.
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Issue-with-Handling-SoapFault-tp5730718.html
> Sent from the Camel - Users mailing list archive at Nabble.com 
> (http://Nabble.com).



Reply via email to