The camel version is 2.4

1)the original code is 
+++++++++++++++
<onException useOriginalMessage="true">                 

<exception>org.apache.camel.processor.validation.SchemaValidationException</exception>
  
 <exception>org.xml.sax.SAXParseException</exception>      
 <exception>org.apache.camel.ValidationException</exception>
 
 <exception>java.lang.Exception</exception>             
 <redeliveryPolicy maximumRedeliveries="0" />                           
 <handled>
  <constant>true</constant>
 </handled>
  <to
  uri="log:xml? 
level=INFO&amp;showException=true&amp;showCaughtException=true&amp;showStackTrace=true"
/>
  <to uri="file:{{retry_loc}}" />
  <to uri="bean:myBean"/>
</onException>

2) My class is 

public class MyBean {
        
        public void doSomething(Object body, Exception cause) { 
                cause.printStackTrace();
        }

}

3)Bean decleration is <bean id="myBean" class="MyBean"></bean> 

Please suggest should i use parameter to the below and try ?

<to uri="bean:myBean?methodName=doSomething"/>


--
View this message in context: 
http://camel.465427.n5.nabble.com/Catch-camel-exception-in-java-code-tp5015714p5016627.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to