Hi, i have onException configured for my camel context, which has couple of routes. i have configured onException as below:
<onException> <exception>java.lang.Exception</exception> <handled> <constant>true</constant> </handled> <setHeader headerName="exception"> <simple>${exception.stacktrace}</simple> </setHeader> <bean ref="frameWorkLogger" method="log"/> </onException> here since my component uses different logging framework, so i just want Camel runtime to call my custom method upon any kind of exception while initalizing routes or during Route Processing. upon calling i log messages using my custom logging framework. this is not working!!! i just introduced one random exception by removing one custom camel component in route, same came runtime throws org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToCreateRouteException: Failed to create route sgDF13 but my custom bean method never get called!!, i implemented my bean as follows: import java.util.Map; import org.apache.camel.Body; import org.apache.camel.Headers; import org.apache.camel.OutHeaders; public class FrameWorkLogger { public Object log(@Headers Map<?, ?> in, @Body String payload, @OutHeaders Map out) { System.out.println("Calling FrameworkLogging"); Logging.log(this.getClass(), LogLevel.ERROR, "Calling FrameworkLogging"); Logging.log(this.getClass(), LogLevel.ERROR, "Exception:-" + payload); return "Error"; } } How do i fix this issue?, please help... Regards, mayur -- View this message in context: http://camel.465427.n5.nabble.com/onException-not-working-tp5779542.html Sent from the Camel - Users mailing list archive at Nabble.com.