You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Srinivas (JIRA)" <ji...@apache.org> on 2016/08/30 18:36:20 UTC

[jira] [Updated] (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 ]

Srinivas updated CAMEL-10277:
-----------------------------
    Description: 
I have a route which is using onException. When I wrote a CBTS with weaving, test is failing with the below exception. 

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

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
	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();
				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}

  was:
I have a route which is using onException. When I wrote a CBTS with weaving, test is failing with the below exception. 

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

Here is the Sample Route and Test class to reproduce.

<code>
public class OnExceptionRouteIdTest extends CamelBlueprintTestSupport {

	private static final String START = "direct:start";

	@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();
				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>


> "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-core, camel-test
>    Affects Versions: 2.16.2
>         Environment: Karaf, Camel
>            Reporter: Srinivas
>            Assignee: Grzegorz Grzybek
>
> I have a route which is using onException. When I wrote a CBTS with weaving, test is failing with the below exception. 
> 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]]]]
> 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
> 	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();
> 				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)