When deploying a minimal Grails application to Tomcat 6.0.20 on Windows, everything works fine. When the same application is undeployed, the following libraries are locked and cannot be removed by Tomcat.
The same problem also happens if the application is configured to use the MSSQL JDBC 2.0 driver. The first time the application is deployed the database connections work fine, when the application is undeployed it does not remove the driver's JAR file and also subsequent deployments fail with JDBC connection issues.
When deploying the exact same application on Tomcat 6.0.24 on Windows, none of the problems mentioned above occur. However the Tomcat log contains a bunch of errors like the following...
SEVERE: A web application created a ThreadLocal with key of type [org.codehaus.groovy.runtime.GroovyCategorySupport.MyThreadLocal] (value [org.codehaus.groovy.runtime.GroovyCategorySupport$MyThreadLocal@d32ea0]) and a value of type [java.lang.ref.SoftReference] (value [java.lang.ref.SoftReference@9a288b]) but failed to remove it when the web application was stopped. To prevent a memory leak, the ThreadLocal has been forcibly removed.
The full log file is attached to this issue as well as the sample grails application which triggers these errors.
The purpose of the issue would be to fix the locking issues under Tomcat 6.0.20 and to clean up the SEVERE messages in the log file under Tomcat 6.0.24.
Please let me know if you require any additional information. Thanks!