我正在用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