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