You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Willem Jiang (JIRA)" <ji...@apache.org> on 2012/08/22 07:00:41 UTC

[jira] [Commented] (CAMEL-5456) Context scoped exception clauses incorrectly applying across RouteBuilders

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

Willem Jiang commented on CAMEL-5456:
-------------------------------------

Hi Andreas,
If you are using Context scoped exception clause,the error handler will be affect across the CamelContext, as the JAVA DSL onException() is called one by one in the two different route builder, the route will be effected different if the onException is called in different sequences. I don't think there is way to fix it in JAVA DSL, unless we setup the context scoped exception in one RouteBuilders or using the route scoped exception clauses.

The error the test can be fixed by setting the onException to be route scoped like the one I just committed a fixed test into the trunk.
                
> Context scoped exception clauses incorrectly applying across RouteBuilders
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-5456
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5456
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.10.0
>            Reporter: Andreas Jacobsen
>            Assignee: Willem Jiang
>         Attachments: camel-core-context-scope-bug.patch, camel-spring-context-scope-bug.patch
>
>
> The attached patch shows a bug in the DefaultExceptionPolicyStrategy or the way ExceptionPolicys are added to a RouteBuilder's errorhandler.
> In ContextScopedOnExceptionMultipleRouteBuildersReverseTest, the ordering of the routes causes the onException(IllegalArgumentException.class) to added to the ExceptionProcessors for the direct:foo-RouteBuilder. When the route is run, the OnExceptionDefinition matches exactly on the exception-type, despite this OnExceptionDefiniton being registered on a different RouteBuilder. As far as we can tell, the processor is later ignored because it's identified as being from a different route-context.
> We have attached corresponding tests for camel-spring that show that the issue is tied to alphabetical ordering of RouteBuilders when using contextscan.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira