ThreadLocal leaking problem came up when upgrading tomcat to 6.0.26, when shutting down tomcat, there will be exceptions like:
A web application created a ThreadLocal with key of type [null] and a value of type [java.lang.ref.WeakReference]
but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
For portal itself(excluding the third side library), if we suppose all clients use ThreadLocalFilter correctly, then it will not cause leaking problem.
So, to avoid tomcat's error log, do cleaning as tomcat does when undeploying portal.