billbarker 2002/10/11 22:34:53 Modified: src/facade22/org/apache/tomcat/facade Servlet22Interceptor.java Log: Set the Thread ContextClassLoader to the webapp-CL when unbinding on expiry. While not specified in the Spec, this seems to be the only state that can be programmed against (and IMHO, should be in the spec). Reported By: Aaron Mulder [EMAIL PROTECTED] Revision Changes Path 1.20 +8 -0 jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java Index: Servlet22Interceptor.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/facade22/org/apache/tomcat/facade/Servlet22Interceptor.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -r1.19 -r1.20 --- Servlet22Interceptor.java 27 Oct 2001 02:55:20 -0000 1.19 +++ Servlet22Interceptor.java 12 Oct 2002 05:34:53 -0000 1.20 @@ -62,6 +62,7 @@ import org.apache.tomcat.util.*; import org.apache.tomcat.util.collections.SimplePool; +import org.apache.tomcat.util.compat.Jdk11Compat; import org.apache.tomcat.core.*; import java.io.*; import java.net.*; @@ -179,6 +180,7 @@ } } + static Jdk11Compat jdk11Compat = Jdk11Compat.getJdkCompat(); /** Call the Servlet22 callbacks when session expires. */ @@ -197,6 +199,9 @@ Vector removed=null; // lazy Enumeration e = sess.getAttributeNames(); + ClassLoader clSave = jdk11Compat.getContextClassLoader(); + jdk11Compat.setContextClassLoader(sess.getContext(). + getClassLoader()); // announce all values with listener that we'll remove them while( e.hasMoreElements() ) { String key = (String) e.nextElement(); @@ -214,6 +219,9 @@ if( removed==null) removed=new Vector(); removed.addElement( key ); } + } + if( clSave != null ) { + jdk11Compat.setContextClassLoader(clSave); } if( removed!=null ) { // remove
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>