我正在用j2ee,hibernate和Spring构建一个web应用程序。在某个时候,应用程序必须发送一些电子邮件,所以我想把这个任务放在一个单独的线程中。详细信息:在应用程序终止时的春天,线程和警告
- 上有一些状态变量的线程和控制器共享
- 同步化没有对与控制器共享服务豆同步(应该是什么?)。
无论如何,当我关闭应用程序,我收到以下担心消息:
...
INFO: Closing Hibernate SessionFactory
25-mar-2011 10.02.14 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
GRAVE: The web application [/Tomcat6Locale] registered the JDBC driver [org.hsqldb.jdbc.JDBCDriver] but failed to unregister it when the web application was stopped. To prevent a memory leak, the JDBC Driver has been forcibly unregistered.
25-mar-2011 10.02.14 org.apache.catalina.loader.WebappClassLoader clearReferencesJdbc
GRAVE: The web application [/Tomcat6Locale] 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.
25-mar-2011 10.02.14 org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
GRAVE: The web application [/Tomcat6Locale] appears to have started a thread named [MySQL Statement Cancellation Timer] but has failed to stop it. This is very likely to create a memory leak.
25-mar-2011 10.02.15 org.apache.coyote.http11.Http11Protocol destroy
INFO: Stopping Coyote HTTP/1.1 on http-8080
,我是不是该线程招之前得到......到底什么时候其中一个线程完成,他们只是返回。我没有做任何特别的事情。我应该做更多吗?
另请参阅http://stackoverflow.com/questions/5292349/this-is-very-likely-to-create-a-memory-leak-tomcat/5292456#5292456 – 2011-03-25 09:39:42