Quantcast

Cannot handle Exception thrown from Splitter Expression

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Cannot handle Exception thrown from Splitter Expression

s_albrecht
After I upgraded from camel 2.2.0 to 2.5.0 I found an issue with exceptions thrown by splitter expressions.
These exceptions are neither caught by route local error handlers nor by global error handlers. Is this a feature or bug ?
See attached JUnit for details.
SplitterTest.java
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

Claus Ibsen-2
Hi

Thanks for reporting.

The issue is that the exception occurs in the evaluate of the
expression which happens before Camel routes the splitted message.
Then the exception is caught by the splitter EIP and it regard the
exception as being exhausted. And therefore the onException doesn't
kick in.
Camel assumed the exception was exhausted (which isn't the case).

I have created a ticket
https://issues.apache.org/jira/browse/CAMEL-3394

On Tue, Nov 30, 2010 at 2:14 PM, s_albrecht <[hidden email]> wrote:

>
> After I upgraded from camel 2.2.0 to 2.5.0 I found an issue with exceptions
> thrown by splitter expressions.
> These exceptions are neither caught by route local error handlers nor by
> global error handlers. Is this a feature or bug ?
> See attached JUnit for details.
> http://camel.465427.n5.nabble.com/file/n3286043/SplitterTest.java
> SplitterTest.java
> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-handle-Exception-thrown-from-Splitter-Expression-tp3286043p3286043.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

rmorris
I think I've found a similar case when the exception occurs within a split().method()

In this case, the exception is thrown inside the method() and doesn't make it to the onException() handler.
Adding a .onException() into the direct://testsplitter route doesn't seem to make any difference.

Is this indeed a bug?

SplitterTest2.java

Rick Morris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

Jim Newsham
On 2/10/2011 9:41 AM, rmorris wrote:

> I think I've found a similar case when the exception occurs within a
> split().method()
>
> In this case, the exception is thrown inside the method() and doesn't make
> it to the onException() handler.
> Adding a .onException() into the direct://testsplitter route doesn't seem to
> make any difference.
>
> Is this indeed a bug?
>
> http://camel.465427.n5.nabble.com/file/n3379965/SplitterTest2.java
> SplitterTest2.java
>
> Rick Morris
>

I've had this same issue, just haven't had the time to look into it or
reproduce it in isolation.  split().method(...).  I ended up putting a
try/catch/log in my splitter method code, which was sufficient for my
purposes.

Jim
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

s_albrecht
In reply to this post by rmorris
Your test produces a similar situation to mine. Since Claus Ibsen fixed this in 2.6.0 trunk, I regard this as a bug, not as a feature. Unluckily I did not have the chance yet to verify the fix. I am still stuck with 2.5.0, there is the workaround of try - catch in the splitter method.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

rmorris
s_albrecht wrote
Your test produces a similar situation to mine. Since Claus Ibsen fixed this in 2.6.0 trunk, I regard this as a bug, not as a feature. Unluckily I did not have the chance yet to verify the fix. I am still stuck with 2.5.0, there is the workaround of try - catch in the splitter method.
I'm using 2.6.0 and your problem is indeed fixed.
While the try/catch works for my purpose, it means that I can't use onException where it does work and have to implement try/catch there as well.

Is the bug I reported going to be accepted into jira?

Rick Morris
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

scott sinclair
This post was updated on .
I have exactly the same problem with camel-core (2.7.1.fuse-00-43) running inside fuse-esb 4.4.0-00-43.

I am using the split().method(bean, methodName) syntax and my exception is not picked up by the handler.

Can we reopen the JIRA ticket?

Scott Sinclair
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Cannot handle Exception thrown from Splitter Expression

Claus Ibsen-2
On Fri, Sep 23, 2011 at 3:14 PM, scott sinclair
<[hidden email]> wrote:
> I have exactly the same problem with camel-core (2.7.1.fuse-00-43) running
> inside fuse-esb 4.4.0-00-43.
>
> I am using the split().method(bean, methodName) syntax and my exception is
> not picked up by the handler.
>
> Will this problem be fixed.
>

Yes I have fixed it today.
https://issues.apache.org/jira/browse/CAMEL-4482

Will be ported to Fuse in the 2.8 and 2.7 branches, so it will be in
the next release of Fuse Camel.
http://fusesource.com/issues/browse/MR-523

> --
> View this message in context: http://camel.465427.n5.nabble.com/Cannot-handle-Exception-thrown-from-Splitter-Expression-tp3286043p4833441.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



--
Claus Ibsen
-----------------
FuseSource
Email: [hidden email]
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Loading...