camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ahiebl <>
Subject Tracing exceptions
Date Fri, 04 Nov 2011 13:50:34 GMT

we add a tracer to our camel context that logs to a JPA table, i.e.
This works fine. 

But when a bean in the traced route throws an exception (e.g.
NullPointerException) I would actually expect to see that in the
causedByException property. But the exception is null.

I think the reason is that in DefaultTraceEventMessage the causedByException
is set to exchange.getException, maybe at a time where it is already
handled. The exception is still available as property
Exchange.CAUSED_BY_EXCEPTION, though.

public DefaultTraceEventMessage(final Date timestamp, final
ProcessorDefinition<?> toNode, final Exchange exchange) {
        this.tracedExchange = exchange;
        this.causedByException = exchange.getException() != null ?
exchange.getException().toString() : null;

Is this a bug or is there another way to get that exception traced. This
would be really helpful for debugging purposes.

Many thanks,

PS: Using Camel 2.6

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

View raw message