camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Srinivas (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (CAMEL-10277) "There are no outputs which matches: * in the route" when OnException is used in the Route with weaving
Date Tue, 30 Aug 2016 18:37:21 GMT

     [ 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. 

{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
	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: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}


> "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. 
> {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
> 	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)

Mime
View raw message