You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Claus Ibsen <cl...@gmail.com> on 2010/12/06 14:00:09 UTC

Re: Cannot handle Exception thrown from Splitter Expression

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 <St...@icw.de> 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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Cannot handle Exception thrown from Splitter Expression

Posted by Claus Ibsen <cl...@gmail.com>.
On Fri, Sep 23, 2011 at 3:14 PM, scott sinclair
<sc...@smartstream-stp.com> 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: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: Cannot handle Exception thrown from Splitter Expression

Posted by scott sinclair <sc...@smartstream-stp.com>.
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.

--
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.

Re: Cannot handle Exception thrown from Splitter Expression

Posted by rmorris <rm...@enquisite.com>.

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

Re: Cannot handle Exception thrown from Splitter Expression

Posted by s_albrecht <St...@icw.de>.
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.
-- 
View this message in context: http://camel.465427.n5.nabble.com/Cannot-handle-Exception-thrown-from-Splitter-Expression-tp3286043p3380761.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Cannot handle Exception thrown from Splitter Expression

Posted by Jim Newsham <jn...@referentia.com>.
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

Re: Cannot handle Exception thrown from Splitter Expression

Posted by rmorris <rm...@enquisite.com>.
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

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