On Sat, Nov 7, 2009 at 8:11 AM, Christian Schneider <[email protected]> wrote: > Hi, > > I have also woked with the onException clause recently and it worked for me. > I used the spring dsl though. > It surely would help if you can create a small example project that shows > your problem and post it for example > to a jira ticket. Once there is some code that can be debugged it is > ususally quite easy to find a solution. >
Yeah well said. We cant really help you if you just say - Hey it dont work. Help is much faster if you provide a detailed error report and have a sample that we can run that demonstrates the issue. And there are really a lot of unit tests for error handling so I wonder it could be a mis configuration or whatever on your side. > Greetings > > Christian > > > DRy schrieb: >> >> Hi, >> >> we use one of the latest 2.1 snapshots (I will have a look at the exact >> date >> tomorrow). >> >> We use the onException-expressions (from the example below) in a >> RouteBuilder-class with one defined route. Both onException are placed >> before the route definition. So far the scope is global. >> >> >> DRy >> >> >> Claus Ibsen-2 wrote: >> >>> >>> What version of Camel are you using? >>> >>> And do you use global or route scoped onException ? >>> >>> On Thu, Nov 5, 2009 at 3:28 PM, DRy <[email protected]> wrote: >>> >>>> >>>> Hi, >>>> >>>> if I use two onException expressions in a route definition like this >>>> >>>> onException(UnmarshalException.class) >>>> .useOriginalBody() >>>> .handled(true) >>>> .bean(exceptionLogBean) >>>> .process(new Publish2CenterExceptionBean()) >>>> .end(); >>>> >>>> onException(Exception.class) >>>> .maximumRedeliveries(-1).redeliveryDelay(1000) >>>> .useOriginalBody() >>>> .handled(true) >>>> .bean(exceptionLogBean) >>>> .rollback() >>>> .end(); >>>> >>>> I got two problems: >>>> >>>> 1) >>>> The onEception(Exception.class) part is used all the time! Even if an >>>> UnmarshalException (direct hit) is thrown. And no matter if I put >>>> onException(Exception.class)... before >>>> onException(UnmarshalException.class)... ... ? >>>> >>>> 2) >>>> On the onException(Exception.class) part the bean(exceptionLogBean) is >>>> never >>>> called ... ? >>>> >>>> What I try to do is, to handle all "known" exception in seperate >>>> onException(...) parts and install a "last line of defence" with the >>>> onException(Exception.class). >>>> >>>> >>>> DRy >>>> >> >> > > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus
