[jira] Created: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

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

[jira] Created: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
Exceptions thrown from when - methodCall are not caught by onException
----------------------------------------------------------------------

                 Key: CAMEL-1188
                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
             Project: Apache Camel
          Issue Type: Bug
    Affects Versions: 1.5.0
            Reporter: Rikard Eriksen


See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?

<camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
        <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
        <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
        <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
        <route>
                <from ref="myMainQueue" />
                <onException>
                        <exception>my.project.queue.ExceptionOneException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionOneQueue"/>
                </onException>
                <onException>
                        <exception>my.project.queue.ExceptionTwoException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionTwoQueue"/>
                </onException>
                <onException>
                        <exception>java.lang.Exception</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>false</constant>
                        </handled>
                </onException>
                <unmarshal>
                        <jaxb prettyPrint="true" contextPath="my.project.domain" />
                </unmarshal>
                <choice>
                        <when>
                                <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
                        </when>
                        <otherwise>
                                <to uri="bean:beanOne?methodName=methodFromBeanOne" />
                        </otherwise>
                </choice>
        </route>
</camelContext>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48206#action_48206 ]

Rikard Eriksen commented on CAMEL-1188:
---------------------------------------

Here's the Nabble thread for this: http://www.nabble.com/Will-onException-handle-exceptions-thrown-from-%27when%27-clause--ts21033017s22882.html

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48206#action_48206 ]

sagnet edited comment on CAMEL-1188 at 12/16/08 7:14 AM:
-----------------------------------------------------------------

Here's the Nabble thread for this: http://www.nabble.com/Will-onException-handle-exceptions-thrown-from-%27when%27-clause--ts21033017s22882.html I've tried using <filter> instead of <choice>/<when>/<otherwise>, which gives the same results. So my assumption is that it is the use of <methodCall> intead of <to> that causes the exception not to be caught.

      was (Author: sagnet):
    Here's the Nabble thread for this: http://www.nabble.com/Will-onException-handle-exceptions-thrown-from-%27when%27-clause--ts21033017s22882.html I've tried using filter instedead of choice/when/otherwise, which gives the same results. So my assumption is that it is the use of <methodCall> intead of <to> that causes the exception not to be caught.
 

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Issue Comment Edited: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48206#action_48206 ]

sagnet edited comment on CAMEL-1188 at 12/16/08 7:14 AM:
-----------------------------------------------------------------

Here's the Nabble thread for this: http://www.nabble.com/Will-onException-handle-exceptions-thrown-from-%27when%27-clause--ts21033017s22882.html I've tried using filter instedead of choice/when/otherwise, which gives the same results. So my assumption is that it is the use of <methodCall> intead of <to> that causes the exception not to be caught.

      was (Author: sagnet):
    Here's the Nabble thread for this: http://www.nabble.com/Will-onException-handle-exceptions-thrown-from-%27when%27-clause--ts21033017s22882.html
 

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1188:
-------------------------------

      Component/s: camel-spring
                   camel-core
    Fix Version/s: 2.0.0
                   1.5.1
         Assignee: Claus Ibsen

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core, camel-spring
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Updated: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen updated CAMEL-1188:
-------------------------------

    Description:
See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?

{code}
<camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
        <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
        <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
        <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
        <route>
                <from ref="myMainQueue" />
                <onException>
                        <exception>my.project.queue.ExceptionOneException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionOneQueue"/>
                </onException>
                <onException>
                        <exception>my.project.queue.ExceptionTwoException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionTwoQueue"/>
                </onException>
                <onException>
                        <exception>java.lang.Exception</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>false</constant>
                        </handled>
                </onException>
                <unmarshal>
                        <jaxb prettyPrint="true" contextPath="my.project.domain" />
                </unmarshal>
                <choice>
                        <when>
                                <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
                        </when>
                        <otherwise>
                                <to uri="bean:beanOne?methodName=methodFromBeanOne" />
                        </otherwise>
                </choice>
        </route>
</camelContext>
{code}

  was:
See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?

<camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
        <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
        <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
        <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
        <route>
                <from ref="myMainQueue" />
                <onException>
                        <exception>my.project.queue.ExceptionOneException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionOneQueue"/>
                </onException>
                <onException>
                        <exception>my.project.queue.ExceptionTwoException</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>true</constant>
                        </handled>
                        <to ref="exceptionTwoQueue"/>
                </onException>
                <onException>
                        <exception>java.lang.Exception</exception>
                        <redeliveryPolicy maximumRedeliveries="0" />
                        <handled>
                                <constant>false</constant>
                        </handled>
                </onException>
                <unmarshal>
                        <jaxb prettyPrint="true" contextPath="my.project.domain" />
                </unmarshal>
                <choice>
                        <when>
                                <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
                        </when>
                        <otherwise>
                                <to uri="bean:beanOne?methodName=methodFromBeanOne" />
                        </otherwise>
                </choice>
        </route>
</camelContext>


> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core, camel-spring
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> {code}
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>
> {code}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Commented: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

    [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=48210#action_48210 ]

Claus Ibsen commented on CAMEL-1188:
------------------------------------

Ah I got it. This is already fixed in Camel 1.5.1

When you use bean for predicates and they throw an exception it's wrapped in a RuntimeBeanExpressionException. And sadly Camel 1.5.0 does not look into the exception tree to find the real caused exception.

Rikard you can try the 1.5.1-SNAPSHOT
http://activemq.apache.org/camel/download.html

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core, camel-spring
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> {code}
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>
> {code}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply | Threaded
Open this post in threaded view
|

[jira] Resolved: (CAMEL-1188) Exceptions thrown from when - methodCall are not caught by onException

JIRA jira@apache.org
In reply to this post by JIRA jira@apache.org

     [ https://issues.apache.org/activemq/browse/CAMEL-1188?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-1188.
--------------------------------

    Resolution: Fixed

Already fixed in 1.5.1 (will now look into exception tree to find the real caused exception)

> Exceptions thrown from when - methodCall are not caught by onException
> ----------------------------------------------------------------------
>
>                 Key: CAMEL-1188
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-1188
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core, camel-spring
>    Affects Versions: 1.5.0
>            Reporter: Rikard Eriksen
>            Assignee: Claus Ibsen
>             Fix For: 1.5.1, 2.0.0
>
>
> See the route below. beanOne throws ExceptionOneException and beanTwo throws ExceptionTwoException. ExceptionOneException it caught and handled as it's supposed to.  But ExceptionTwoException goes all the way through, without  being caught and routed to the exceptionTwoQueue. Is it the when tag or the methodCall tag that is the cause of this?
> {code}
> <camelContext id="MyCamelContext xmlns="http://activemq.apache.org/camel/schema/spring">
> <endpoint id="myMainQueue" uri="activemq:${my.project.queue.main}"/>
> <endpoint id="exceptionOneQueue" uri="activemq:${my.project.queue.exceptionOne}"/>
> <endpoint id="exceptionTwoQueue" uri="activemq:${my.project.queue.exceptionTwo}"/>
> <route>
> <from ref="myMainQueue" />
> <onException>
> <exception>my.project.queue.ExceptionOneException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionOneQueue"/>
> </onException>
> <onException>
> <exception>my.project.queue.ExceptionTwoException</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>true</constant>
> </handled>
> <to ref="exceptionTwoQueue"/>
> </onException>
> <onException>
> <exception>java.lang.Exception</exception>
> <redeliveryPolicy maximumRedeliveries="0" />
> <handled>
> <constant>false</constant>
> </handled>
> </onException>
> <unmarshal>
> <jaxb prettyPrint="true" contextPath="my.project.domain" />
> </unmarshal>
> <choice>
> <when>
> <methodCall bean="beanTwo" method="methodFromBeanTwo"/>
> </when>
> <otherwise>
> <to uri="bean:beanOne?methodName=methodFromBeanOne" />
> </otherwise>
> </choice>
> </route>
> </camelContext>
> {code}

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.