先说说情况.
两个项目 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,内存分配足够.
tomcat的进程被kill掉时也会报以上likely to create a memory leak的错误 参考一下:http://www.blogjava.net/qileilove/archive/2011/11/25/364838.html