Summary: | Reference from javax.security.auth.login.LoginContext.contextClassLoader initalized in static code block prevents an undeployed Web application from being garbage collected (similar to #49669) | ||
---|---|---|---|
Product: | Tomcat 7 | Reporter: | Justin Almquist <justin.almquist> |
Component: | Catalina | Assignee: | Tomcat Developers Mailing List <dev> |
Status: | RESOLVED FIXED | ||
Severity: | enhancement | ||
Priority: | P2 | ||
Version: | 7.0.4 | ||
Target Milestone: | --- | ||
Hardware: | Macintosh | ||
OS: | All | ||
Attachments: | patch for tc 7 |
Description
Justin Almquist
2010-11-16 20:14:17 UTC
I think I confused myself a little while researching this and somehow referenced javax.security.auth.login.LoginContext when in fact I *meant* javax.security.auth.login.Configuration. The LoginContext may be a problem as well, however the Configuration class is what is being listed in YourKit as the offending class causing the WebappClassloader to stick around. Once again, here's the output of YourKit: "contextClassLoader of javax.security.auth.login.Configuration [Class]" Then, looking at the code for Configuration (http://kickjava.com/src/javax/security/auth/login/Configuration.java.htm), the following line of code is similar to the problem fixed by bug #49669 (https://issues.apache.org/bugzilla/show_bug.cgi?id=49669) "private static ClassLoader JavaDoc contextClassLoader;" Sorry for any confusion... Created attachment 26309 [details]
patch for tc 7
Here is a patch for tc 7. It just loads the faulty class in the JreMemoryLeakPreventionListener:
Class.forName("javax.security.auth.login.Configuration", true, ClassLoader.getSystemClassLoader());
Is there any recipe how to reproduce this issue? (A sample webapp, and/or configuration)? I don't have a sample webapp, however this article describes exactly how we setup our authentication mechanism using JAAS: http://download.oracle.com/javase/1.4.2/docs/guide/security/jgss/tutorials/AcnOnly.html patch applied on trunk, will be available for tomcat 7.0.6 Backport to tomcat 6 proposed. Applied to 6.0.x and will be included in 6.0.30 onwards. |