tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core StandardContext.java
Date Wed, 02 Mar 2005 18:14:06 GMT
remm        2005/03/02 10:14:06

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  - Fix context classloader binding during loader initialization (it was set to null before).
  - The webapp loader should only be retrieved when the context classloader is set to the
webapp's classloader. The initialization of
    StandardContainer violates this by having its basic valve instantiated, which in turns
gets the logger right away. This means it will use
    whatever logging configuration is defined for the server classloader :(
  
  Revision  Changes    Path
  1.166     +7 -5      jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.165
  retrieving revision 1.166
  diff -u -r1.165 -r1.166
  --- StandardContext.java	24 Feb 2005 17:11:06 -0000	1.165
  +++ StandardContext.java	2 Mar 2005 18:14:06 -0000	1.166
  @@ -4007,8 +4007,6 @@
                   // Start our subordinate components, if any
                   if ((loader != null) && (loader instanceof Lifecycle))
                       ((Lifecycle) loader).start();
  -                if ((logger != null) && (logger instanceof Lifecycle))
  -                    ((Lifecycle) logger).start();
   
                   // Unbinding thread
                   unbindThread(oldCCL);
  @@ -4016,6 +4014,8 @@
                   // Binding thread
                   oldCCL = bindThread();
   
  +                if ((logger != null) && (logger instanceof Lifecycle))
  +                    ((Lifecycle) logger).start();
                   if ((cluster != null) && (cluster instanceof Lifecycle))
                       ((Lifecycle) cluster).start();
                   if ((realm != null) && (realm instanceof Lifecycle))
  @@ -4483,8 +4483,10 @@
           if (getResources() == null)
               return oldContextClassLoader;
   
  -        Thread.currentThread().setContextClassLoader
  -            (getLoader().getClassLoader());
  +        if (getLoader().getClassLoader() != null) {
  +            Thread.currentThread().setContextClassLoader
  +                (getLoader().getClassLoader());
  +        }
   
           DirContextURLStreamHandler.bind(getResources());
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org


Mime
View raw message