Hi You cannot do onException while doing onException, as this gets complicated, and you could potentially end up in a endless loop or whatever. When the 2nd exception is detected Camel will log this at ERROR level using a FatalFallbackErrorHandler.
On Fri, Feb 10, 2012 at 2:56 PM, atg roxx <atgr...@gmail.com> wrote: > Hi , > > > I have a situation: > > In general in a camel when we have any exception in a route the onException > is called. > > for example : > > onException definition: > ------------------------------- > onException( MyException mye) > .process(new Processor() { > @Override > public void process(Exchange exchange) throws Exception { > SOP("got my exception"); > } > }); > > camel route: > --------------------- > from(jms:abc) > .process(new Processor() { > @Override > public void process(Exchange exchange) throws Exception { > throw new MyException(); > } > }); > > > > But if i throw an exception in process block of onException it is not > getting caught in other onException defined. > > for example: > > got and MyException----------- > onException( MyException mye) > .process(new Processor() { > @Override > public void process(Exchange exchange) throws Exception { > // in processor block throwing mytestexception > > throw new MyTestException(); > } > }); > > > I have defined onException which can handle MyTestException. But this is > not getting called :( > ------------------------------------- > onException( MyTestException myte) > .process(new Processor() { > @Override > public void process(Exchange exchange) throws Exception { > > SOP("got my MyTestException "); > } > }); > > > Could please anyone let me know why it is happening??? Also how can we > achieve it. > > > --cheers, > atgroxx -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/