camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ramon Buckland" <>
Subject Attempting to capture Exception from properties using <el>
Date Sat, 06 Dec 2008 11:47:19 GMT
Hi All,

I have come across something unusual which I am hoping someone can shed some
light on.

I am currently testing failure paths of some routes, and as part of the
"reporting" of a failure, I need to send an email.

I have a catch all onException config in the route ..

        <redeliveryPolicy maximumRedeliveries="0"/>
          <to uri="direct:exceptionEmail"/>

Which is designed to perform two tasks,
   (a) forward the "exception" details out to an email
   (b) respond with FAIL back to the "caller"

(b) is working nicely.

For (a), the direct:exceptionEmail looks as follows

      <from uri="direct:exceptionEmail"/>
          <!-- log to help with debug -->
          <setHeader headerName="subject">FAIL - System Status - An
Exception was caught</setHeader>
              An unexpected error occured. Please review the logs for more
          <to uri="smtp://smtpserver?

The problem I am seeing is that the <el> attempting to capture the exception
details is saying there is no "properties"

DEBUG Pipeline                       - Message exchange has failed so
breaking out of pipeline: Exchange[Message: execute-job-1] exception:
javax.el.PropertyNotFoundException: The class
'org.apache.camel.impl.DefaultMessage' does not have the property
'properties'. fault: null

This is well and good, (I can see via the source that, indeed,
org.apache.camel.impl.DefaultMessage does not have a getProperties .. etc)
however, the log which is running before, shows the message does actually
have Properties, and the property I am after (CamelCauseException).

INFO  ExceptionFailure               -
MyException details, org.apache.camel.bean.BeanHolder=bean: aBean, MyException details},
Headers:{org.apache.camel.RedeliveryCounter=0 ... --SNIP Headers-- },
BodyType:String, Body:execute-job-1, Out: null]

Where is the disconnect occuring ? Can Juel (<el>) get to the Properties of
a message ?

I can see that Ognl ( has the
properties exposed (so I might just switch) but if there is a bug, or some
impl to do, let me know and I can dive in to this one.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message