我刚刚开始在我的 Tomcat webapp 中使用 Google Guice,并且在取消部署 WAR 文件时注意到 catalina.out 文件中的以下内容:
May 16, 2011 5:37:24 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Undeploying context [/app]
May 16, 2011 5:37:24 PM org.apache.catalina.loader.WebappClassLoader clearReferencesThreads
SEVERE: A web application appears to have started a thread named [com.google.inject.internal.util.$Finalizer] but has failed to stop it. This is very likely to create a memory leak.
May 16, 2011 5:37:24 PM org.apache.catalina.loader.WebappClassLoader clearThreadLocalMap
SEVERE: A web application created a ThreadLocal with key of type [null] (value [com.google.inject.internal.InjectorImpl$1@10ace8d]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;@7e9bed]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
有谁知道是什么原因造成的,或者我怎样才能阻止它发生?
我只按照这里的说明 http://code.google.com/docreader/#p=google-guice&s=google-guice&t=ServletModule
...而且还没有做任何花哨的事情。我只有 2 个 servlet 和一个过滤器。
谢谢!