larryi 01/01/23 05:17:07 Modified: src/share/org/apache/tomcat/modules/config AutoSetup.java Log: If an expanded context is already defined, try to reload the context instead of recreate it. This has a better chance of preserving the context settings. :-) Note: Context reloading is not currently successful at completely avoiding the bug. If you try to execute the admin/test/test.jsp when the admin.war wasn't already expaned, the request will result in a 500 error. The ServletContext for the JspServlet is still carrying a reference to the old context and its old classloader. This old classloader doesn't have WEB-INF/classes in its urls[] array. If this problem occurs, restart Tomcat. Since the admin.war is already expanded, the problem is avoided. Revision Changes Path 1.4 +21 -6 jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoSetup.java Index: AutoSetup.java =================================================================== RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/modules/config/AutoSetup.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- AutoSetup.java 2001/01/22 21:37:29 1.3 +++ AutoSetup.java 2001/01/23 13:17:07 1.4 @@ -148,15 +148,30 @@ path=""; Context ctx = (Context)definedContexts.get(path); - // if context not defined or was expanded - if( ctx == null || expanded ) { + // if context is defined and was expanded + if( ctx != null && expanded ) { + // we need to reload the context since it was initialized + // before its directories existed. At minimum, its classloader + // needs updating. + if ( ctx.getReloadable() ) { + ctx.setReload( true ); + if( debug > 0 ) + log("setting context " + ctx.toString() + "to reload"); + } else { + log("Warning: predefined context " + ctx.toString() + + " is not reloadable, recreating instead. Some settings may be lost!"); + cm.removeContext(ctx); + // XXX Make sure ctx is destroyed - we may have + // undetected leaks + ctx=null; + } + } + + // if context not defined + if( ctx == null ) { // if no explicit set up and is a directory File f=new File( webappD, name); if (f.isDirectory()) { - // If the context is already defined and was expanded, - // we need to remove it since it was initialized before - // its directories existed. At minimum, its classloader - // needs updating. if ( ctx != null ) cm.removeContext(ctx); ctx=new Context(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, email: [EMAIL PROTECTED]