camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CAMEL-2653) Route with only an endpoint defined causes app failure with only a vague stack trace
Date Sat, 17 Apr 2010 08:21:26 GMT

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

Claus Ibsen resolved CAMEL-2653.
--------------------------------

         Assignee: Claus Ibsen
    Fix Version/s: 2.3.0
       Resolution: Fixed

Its fixed in 2.3 where you get a better error message on startup about this

{code}
org.apache.camel.FailedToCreateRouteException: Failed to create route route1 at: >>>
From[direct://start] <<< in route: Route[[From[direct://start]] -> []] because
of Route route1 has no output processors. You need to add outputs to the route such as to("log:foo").
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:725)
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:140)
	at org.apache.camel.impl.DefaultCamelContext.startRoute(DefaultCamelContext.java:638)
	at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:1296)
	at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1198)
	at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1128)
	at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:56)
	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1003)
	at org.apache.camel.ContextTestSupport.startCamelContext(ContextTestSupport.java:134)
	at org.apache.camel.ContextTestSupport.setUp(ContextTestSupport.java:90)
	at org.apache.camel.impl.RouteNoOutputTest.setUp(RouteNoOutputTest.java:31)
	at com.intellij.junit3.JUnit3IdeaTestRunner.doRun(JUnit3IdeaTestRunner.java:108)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:60)
Caused by: java.lang.IllegalArgumentException: Route route1 has no output processors. You
need to add outputs to the route such as to("log:foo").
	at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:723)
	... 23 more
{code}

> Route with only an endpoint defined causes app failure with only a vague stack trace
> ------------------------------------------------------------------------------------
>
>                 Key: CAMEL-2653
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-2653
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.2.0
>            Reporter: Cott Lang
>            Assignee: Claus Ibsen
>             Fix For: 2.3.0
>
>
> I recently upgraded an application from Camel 2.0 to Camel 2.2 and was greeted with this
stack trace:
> {code}
> org.apache.camel.RuntimeCamelException: org.apache.camel.FailedToStartRouteException:
java.util.NoSuchElementException
> 	at org.apache.camel.util.ObjectHelper.wrapRuntimeCamelException(ObjectHelper.java:1055)
> 	at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:103)
> 	at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:593)
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
> 	at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
> 	at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
> 	at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
> 	at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
> 	at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
> 	at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
> 	at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
> 	at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)
> 	at java.lang.Thread.run(Thread.java:619)
> Caused by: org.apache.camel.FailedToStartRouteException: java.util.NoSuchElementException
> 	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:939)
> 	at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:197)
> 	at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
> 	... 12 more
> Caused by: java.util.NoSuchElementException
> 	at java.util.AbstractList$Itr.next(AbstractList.java:350)
> 	at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:923)
> 	... 14 more
> {code}
> I attached a debugger and walked through DefaultCamelContext to locate the (admittedly
useless) route that caused the problem, commented it out, and was on my way. However, it seems
like this could be trapped and reported better to the user and save the next poor guy some
time. 
> I also noticed that there's no useful TRACE or DEBUG output in here that would have allowed
anyone to easily debug it.
> {code:title=Example}
> <route>
>     <from uri="activemq:queue:somequeue" />
> </route>
> {code}
> I believe this issue is related to CAMEL-2635.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message