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

Claus Ibsen resolved CAMEL-12883.
---------------------------------
       Resolution: Not A Bug
         Assignee: Claus Ibsen
    Fix Version/s: 2.23.0

You need to put the onException inside the route, as advice-with can only 
advice whats inside the selected route.

See this unit test
https://github.com/apache/camel/commit/2c69246054662031dc91b97ea0d81aaea709a2cc

> WeaveByType not working for OnExceptionDefinition in camel 2.21.0
> -----------------------------------------------------------------
>
>                 Key: CAMEL-12883
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12883
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-test
>    Affects Versions: 2.21.0
>            Reporter: Ganesh Lokeshwara
>            Assignee: Claus Ibsen
>            Priority: Major
>             Fix For: 2.23.0
>
>
> Below is my route
> {code:java}
> OnException(Exception.class).handled(true).process(EXCEPTION_PROCESSOR).end()
> from("file:").process(SOME_PROCESSOR).to("file:");
> {code}
> During testing i want to investigate each exchange which goes through 
> OnException block , for which i tried below
> {code:java}
> weaveByType(OnExceptionDefinition.class).after()
>                     .to(assertEndpoint)
> {code}
> when i ran the test i got below error
> {code:java}
> java.lang.IllegalArgumentException: There are no outputs which matches: 
> OnExceptionDefinition in the route
> {code}
> Could you please help in resolving this issue? Please note i have tried 
> adding code mentioned below in test class, but still the same issue.
>  
> {code:java}
> @Override
> public boolean isUseAdviceWith() {
>     return true;
> }
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to