Camel causes Tomcat shutdown to hang
------------------------------------
Key: CAMEL-1751
URL: https://issues.apache.org/activemq/browse/CAMEL-1751
Project: Apache Camel
Issue Type: Bug
Environment: reproduceable on windows and linux
Reporter: david durham
issue is that if I execute DefaultCamelContext().start(),
the tomcat shutdown process will hang.
Here's my spring config. I have the following for 'inbound' return queues.
<bean id="returnQueues" class="com.ReturnedQueueRouteBuilder"
lazy-init="false" init-method="init" destroy-method="stop">
<property name="routes">
<map>
<entry key="${a.returnQueue.name}">
<bean class="com.ReturnedAProcessor">
<property name="x" ref="y" />
</bean>
</entry>
<entry key="${b.returnQueue.name}">
<bean class="com.ReturnedBProcessor">
<property name="x" ref="y />
</bean>
</entry>
</map>
</property>
<property name="camelContext" ref="camelContext" />
<property name="activeMQName" value="${queue.activeMQInstance}" />
<property name="remoteAddress" value="${queue.remoteAddress}" />
</bean>
<bean id="camelContext" class="org.apache.camel.impl.DefaultCamelContext" />
ReturnQueueRouteBuilder looks like:
public class ReturnedQueueRouteBuilder extends RouteBuilder {
...
public void init() {
camelContext.addComponent(activeMQName.trim(),
ActiveMQComponent.activeMQComponent(remoteAddress.trim()));
try {
camelContext.addRoutes(this);
camelContext.start();
} catch (Exception e) {
log.error(e);
}
}
public void stop() {
try {
camelContext.stop();
} catch (Exception e) {
log.error(e);
}
}
@Override
public void configure() throws Exception {
for (Map.Entry<String, Processor> route : routes.entrySet()) {
from(route.getKey()).process(route.getValue());
}
}
I also see the following stack trace on tomcat shutdown, but I do not think
this is directly the cause.
Exception in thread "InactivityMonitor WriteCheck"
java.lang.NoClassDefFoundError:
org/apache/activemq/transport/InactivityMonitor$3
at
org.apache.activemq.transport.InactivityMonitor.writeCheck(InactivityMonitor.java:128)
at
org.apache.activemq.transport.InactivityMonitor$2.run(InactivityMonitor.java:103)
at
org.apache.activemq.thread.SchedulerTimerTask.run(SchedulerTimerTask.java:33)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.ClassNotFoundException:
org.apache.activemq.transport.InactivityMonitor$3
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1387)
at
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
... 5 more
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.