先说说情况.
两个项目 A和B,单独放在同一环境不同tomcat启动都没问题.放在一个tomcat的webapps下面就会出错,只能正常启动其中的一个,另一个就起不来.
其中A项目出错的日志:
2013-6-29 0:27:58 org.apache.catalina.core.StandardContext startInternal
严重: Error listenerStart
2013-6-29 0:27:58 org.apache.catalina.core.StandardContext startInternal
严重: Context [/A] startup failed due to previous errors
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
严重: The web application [/A] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [Timer-1] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-1] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-2] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-3] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-4] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-5] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-6] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-7] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-8] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-9] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [schedulerFactoryBean_Worker-10] but has failed to stop it. This is very likely to create a memory leak.
2013-6-29 0:27:59 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
严重: The web application [/A] appears to have started a thread named [Timer-2] but has failed to stop it. This is very likely to create a memory leak.
刚开始以为是
严重: The web application [/A] registered the JDBC driver [com.mysql.jdbc.Driver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
这个原因造成的问题,但后来[com.mysql.jdbc.Driver] 这个问题解决了,后面的日志依然存在.
从日志来看,好像是quartz出了问题.我看了一下,A和B项目都有用到quartz,我试过统一quartz的jar包或版本,放在tomcat的lib下面,问题仍然存在.
tomcat版本是7,内存分配足够.
求助,如有遇到相同问题而且搞定的经验,希望告知,感谢大家!
这个不像是包冲突导致的,更像是你启动了一个线程,但是却没有释放相应资源。
检查下[schedulerFactoryBean_Worker-7]这个线程是谁启的,是否有地方会关闭?
http://stackoverflow.com/questions/25126980/servlet-has-started-a-thread-but-failed-to-stop-it-memory-leak-in-tomcat
看下上面的回答,应该和你是一个问题。
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。