You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (JIRA)" <ji...@apache.org> on 2016/11/05 12:23:58 UTC

[jira] [Resolved] (CAMEL-10277) "There are no outputs which matches: * in the route" when OnException is used in the Route with weaving

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

Claus Ibsen resolved CAMEL-10277.
---------------------------------
    Resolution: Incomplete

Camel 2.16.x is EOL. Try with newest and report back.

> "There are no outputs which matches: * in the route" when OnException is used in the Route with weaving
> -------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-10277
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10277
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-blueprint, camel-test
>    Affects Versions: 2.16.2
>         Environment: Karaf, Camel
>            Reporter: Srinivas
>            Priority: Minor
>
> I have a route which is using onException. When I wrote a CBTS with weaving, test is failing with the below exception. I could reproduce using a sample route. Please have a look:
> Exception received:
> {panel}
> java.lang.IllegalArgumentException: There are no outputs which matches: * in the route: Route(foo)[[From[direct:start]] -> [OnException[[class java.lang.Exception] -> [SetHeader[error, constant{true}], Stop]], pipeline -> [[To[mock://result], Stop]]]]
> {panel}
> Here is the Sample Route and Test class to reproduce.
> {code:xml}
> public class OnExceptionRouteIdTest extends CamelBlueprintTestSupport {
> 	private static final String START = "direct:start";
> 	@Override
> 	public boolean isUseAdviceWith() {
> 		return true;
> 	}
> 	@Override
> 	protected String getBlueprintDescriptor() {
> 		return "OSGI-INF/blueprint/success.xml";
> 	}
> 	@Override
> 	protected RouteBuilder createRouteBuilder() {
> 		return new OnExceptionRouteIdRouteBuilder();
> 	}
> 	@Override
> 	protected CamelContext createCamelContext() throws Exception {
> 		final CamelContext camelContext = super.createCamelContext();
> 		camelContext.setTracing(true);
> 		camelContext.addComponent("activemq", new StubComponent());
> 		return camelContext;
> 	}
> 	@Test
> 	public void testOnExceptionRouteId() throws Exception {
> 		final MockEndpoint end = getMockEndpoint("mock:result");
> 		context.getRouteDefinition("foo").adviceWith(context, new AdviceWithRouteBuilder() {
> 			@Override
> 			public void configure() throws Exception {
> 				replaceFromWith(START);
> 				//weaveById("toTestWeaving").replace().to(end).stop();
> 				interceptSendToEndpoint("mock:foo")
> 					.skipSendToOriginalEndpoint()
> 					.to("mock:out");
> 				weaveAddLast().to(end);
> 			}
> 		});
> 		context.start();
> 	}
> }
> public class OnExceptionRouteIdRouteBuilder extends RouteBuilder {
> 	@Override
> 	public void configure() throws Exception {
> 		onException(Exception.class).id("myError")
> 			.maximumRedeliveries(0)
> 			.handled(true)
> 			.setHeader("error", constant("true"))
> 			.end()
> 			.stop();
> 		from("direct:foo").routeId("foo")
> 			.to("mock:foo").id("toTestWeaving")
> 			.end();
> 	}
> }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)