This will probably lead to a memory leak in tomcat 7.0.x

I get the error message "It is very likely to create a memory leak error." As soon as I get the error, I could not connect to activeMQ. We recently noticed this error. Here is the track:

27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 1: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 2: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [ActiveMQ Scheduler] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 3: ProducerTemplate] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 4: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 5: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 6: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 7: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 8: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 9: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 10: ActiveMQComponent] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 11: ProducerTemplate] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 12: ProducerTemplate] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [Camel thread 13: ProducerTemplate] but has failed to stop it. This is very likely to create a memory leak. 27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads SEVERE: The web application [/Webapp] appears to have started a thread named [ActiveMQ Connection Worker: tcp://activeMQhost.localnet/192.168.0.15:61616] but has failed to stop it. This is very likely to create a memory leak. 

spring bean

 <bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent"> <property name="brokerURL" value="${url}" /> </bean> 

$ {url} is set to

 tcp://activeMQhost.localnet/192.168.0.15:61616?keepAlive=true&trace=true 

I am trying to connect to activeMQ from one computer to another. For example, Webapp runs on machine1 and activeMQ running on activeMQhost . Several times, for some reason, the thread could not close. You can find out the connection URL at the end of the trace:

 tcp://activeMQhost.localnet/192.168.0.15:61616 
+4
source share
2 answers

You may need to specify a destory-method for your factory bean connection (usually this is a β€œstop” for ActiveMQ, not sure about the camel version).

 <bean id="..." class="..." destroy-method="stop"> ... </bean> 
+1
source

you can instead use the transfer when moving to another resource ... it is more reliable even for one broker connection.

http://activemq.apache.org/failover-transport-reference.html

0
source

Source: https://habr.com/ru/post/1399041/


All Articles