remm        01/06/05 00:55:29

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContextValve.java
  Log:
  - Will now bind/unbind the thread (in addition to the CL), which should make
    the classloading more robust. This *may* fix the problems with jBoss and
    optimized VM local RMI servers which may replace the context CL of the thread
    (like jBoss does). The fix is totally untested, but after reading some code in 
jBoss,
    I think it should fix the issue.
    The ultimate fix for this would still be to write a specialized CL which would 
directly
    access the directory context, instead of going through URLs (which of course is
    quite convinient, since the URLClassLoader takes care of the management of the
    JARs files containing the classes.
  
  Revision  Changes    Path
  1.10      +11 -21    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java
  
  Index: StandardContextValve.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- StandardContextValve.java 2001/03/30 19:33:37     1.9
  +++ StandardContextValve.java 2001/06/05 07:55:27     1.10
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
 1.9 2001/03/30 19:33:37 craigmcc Exp $
  - * $Revision: 1.9 $
  - * $Date: 2001/03/30 19:33:37 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContextValve.java,v
 1.10 2001/06/05 07:55:27 remm Exp $
  + * $Revision: 1.10 $
  + * $Date: 2001/06/05 07:55:27 $
    *
    * ====================================================================
    *
  @@ -72,6 +72,7 @@
   import javax.servlet.http.HttpServletResponse;
   import javax.naming.NamingException;
   import org.apache.naming.ContextBindings;
  +import org.apache.naming.resources.DirContextURLStreamHandler;
   import org.apache.catalina.Container;
   import org.apache.catalina.Manager;
   import org.apache.catalina.Request;
  @@ -92,7 +93,7 @@
    * when processing HTTP requests.
    *
    * @author Craig R. McClanahan
  - * @version $Revision: 1.9 $ $Date: 2001/03/30 19:33:37 $
  + * @version $Revision: 1.10 $ $Date: 2001/06/05 07:55:27 $
    */
   
   final class StandardContextValve
  @@ -211,25 +212,14 @@
        // Ask this Wrapper to process this Request
        response.setContext(context);
   
  -/*
  -        if (context.isUseNaming()) {
  -            try {
  -                // Bind the thread to the context
  -                ContextBindings.bindThread(context, context);
  -            } catch (NamingException e) {
  -                e.printStackTrace();
  -            }
  -        }
  -*/
  +        // Bind current thread with the resources
  +        DirContextURLStreamHandler.bindThread(context.getResources());
   
  -     wrapper.invoke(request, response);
  -
  -/*
  -        if (context.isUseNaming()) {
  -            // Unbind the thread to the context
  -            ContextBindings.unbindThread(context, context);
  +        try {
  +            wrapper.invoke(request, response);
  +        } finally {
  +            DirContextURLStreamHandler.unbindThread();
           }
  -*/
   
       }
   
  
  
  

Reply via email to