Return-Path: Delivered-To: apmail-camel-users-archive@www.apache.org Received: (qmail 28460 invoked from network); 7 Nov 2009 07:11:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 Nov 2009 07:11:44 -0000 Received: (qmail 26683 invoked by uid 500); 7 Nov 2009 07:11:44 -0000 Delivered-To: apmail-camel-users-archive@camel.apache.org Received: (qmail 26633 invoked by uid 500); 7 Nov 2009 07:11:43 -0000 Mailing-List: contact users-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@camel.apache.org Delivered-To: mailing list users@camel.apache.org Received: (qmail 26623 invoked by uid 99); 7 Nov 2009 07:11:43 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Nov 2009 07:11:43 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [62.75.158.78] (HELO mail.liquid-reality.de) (62.75.158.78) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Nov 2009 07:11:34 +0000 Received: from [10.0.0.10] (HSI-KBW-085-216-025-040.hsi.kabelbw.de [85.216.25.40]) by mail.liquid-reality.de (Postfix) with ESMTP id 55CD4B38008 for ; Sat, 7 Nov 2009 07:11:14 +0000 (UTC) Message-ID: <4AF51D9D.6020602@die-schneider.net> Date: Sat, 07 Nov 2009 08:11:25 +0100 From: Christian Schneider User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: users@camel.apache.org Subject: Re: Exception handling ... onException References: <26215607.post@talk.nabble.com> <5380c69c0911050654j191e5e10taf050290759bdec5@mail.gmail.com> <26222792.post@talk.nabble.com> In-Reply-To: <26222792.post@talk.nabble.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org 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. 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 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 >>> > >