camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Handling Exception from marshal/unmarshal
Date Tue, 12 May 2009 04:23:21 GMT
On Tue, May 12, 2009 at 2:13 AM, Joe Gottman <> wrote:
>   I am using Camel version 2.0M1.  When I call unmarshal() using the Jaxb
> format I want to handle any exceptions thrown by the unmarshal() call.  I
> use an onException() statement and the Exception is being caught.  However,
> when I later try to handle the exception by setting the Message body to my
> own error string, this always fails.  The output is always the same stack
> trace that I would have gotten if I had not handled the exception.

Can you show the route DSL how you do this? You should generally use
handled(true) to clear the exception.
Or use doTry() .. doCatch() just as you would use try .. catch in normal Java

Or if you use a processor, you should be able to do
exchange.setException(null) to clear the exception.

> --
> View this message in context:
> Sent from the Camel Development mailing list archive at

Claus Ibsen
Apache Camel Committer

Open Source Integration:
Apache Camel Reference Card:
Interview with me:

View raw message