craigmcc    01/04/17 12:27:20

  Modified:    catalina/src/share/org/apache/catalina/core
                        StandardContext.java
  Log:
  Restore the ability to save and reload active sessions across a web app
  restart.  This was broken by the refactoring of the load() and unload() calls
  that was recently done in the session manager code.
  
  The problem was a ClassNotFoundException (on a class found in WEB-INF/classes)
  when the session manager attempted to load the saved session.  This was in turn
  due to the fact that the URLStreamHandler for the directory context was not
  initialized when this attempt was happening.  Rearranging the order of the
  steps fixes the problem.
  
  PLEASE run the entire "tester" suite, as well as the Watchdog 4.0 tests, to
  ensure that we do not introduce regressions like this on future changes.
  
  Revision  Changes    Path
  1.54      +13 -13    
jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java
  
  Index: StandardContext.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
  retrieving revision 1.53
  retrieving revision 1.54
  diff -u -r1.53 -r1.54
  --- StandardContext.java      2001/04/15 10:45:28     1.53
  +++ StandardContext.java      2001/04/17 19:27:14     1.54
  @@ -1,7 +1,7 @@
   /*
  - * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.53 2001/04/15 10:45:28 kief Exp $
  - * $Revision: 1.53 $
  - * $Date: 2001/04/15 10:45:28 $
  + * $Header: 
/home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/core/StandardContext.java,v
 1.54 2001/04/17 19:27:14 craigmcc Exp $
  + * $Revision: 1.54 $
  + * $Date: 2001/04/17 19:27:14 $
    *
    * ====================================================================
    *
  @@ -141,7 +141,7 @@
    *
    * @author Craig R. McClanahan
    * @author Remy Maucherat
  - * @version $Revision: 1.53 $ $Date: 2001/04/15 10:45:28 $
  + * @version $Revision: 1.54 $ $Date: 2001/04/17 19:27:14 $
    */
   
   public class StandardContext
  @@ -2312,15 +2312,6 @@
            }
        }
   
  -        // Restart our session manager
  -     if ((manager != null) && (manager instanceof Lifecycle)) {
  -         try {
  -             ((Lifecycle) manager).start();
  -         } catch (LifecycleException e) {
  -             log(sm.getString("standardContext.startingManager"), e);
  -         }
  -     }
  -
           // Create and register the associated naming context, if internal 
           // naming is used
           boolean ok = true;
  @@ -2335,6 +2326,15 @@
           }
   
           DirContextURLStreamHandler.bind(getResources());
  +
  +        // Restart our session manager (AFTER naming context recreated/bound)
  +        if ((manager != null) && (manager instanceof Lifecycle)) {
  +            try {
  +                ((Lifecycle) manager).start();
  +            } catch (LifecycleException e) {
  +                log(sm.getString("standardContext.startingManager"), e); 
  +            }
  +        }
   
           // Restart our application event listeners and filters
           if (ok) {
  
  
  

Reply via email to