You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by co...@apache.org on 2003/04/05 06:02:09 UTC

cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup HostConfig.java

costin      2003/04/04 20:02:08

  Modified:    catalina/src/share/org/apache/catalina/startup
                        HostConfig.java
  Log:
  If a restart stops ( for example bad web.xml ), it should be possible to
  fix the error and have the context load again. So errors in stop() should
  be ignored.
  
  Revision  Changes    Path
  1.8       +15 -8     jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java
  
  Index: HostConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/HostConfig.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- HostConfig.java	25 Mar 2003 17:57:54 -0000	1.7
  +++ HostConfig.java	5 Apr 2003 04:02:08 -0000	1.8
  @@ -93,6 +93,7 @@
   import org.apache.catalina.LifecycleListener;
   import org.apache.catalina.Logger;
   import org.apache.catalina.core.StandardHost;
  +import org.apache.catalina.core.StandardContext;
   import org.apache.catalina.util.StringManager;
   
   
  @@ -716,11 +717,17 @@
           boolean result = true;
           try {
               ((Lifecycle) context).stop();
  -            // Note: If the context was already stopped, a 
  -            // Lifecycle exception will be thrown, and the context
  -            // won't be restarted
  +        } catch( Exception ex ) {
  +            log.warn("Erorr stopping context " + context.getName()  +  " " +
  +                    ex.toString());
  +        }
  +        // if the context was not started ( for example an error in web.xml)
  +        // we'll still get to try to start
  +        try {
               ((Lifecycle) context).start();
  -        } catch (LifecycleException e) {
  +        } catch (Exception e) {
  +            log.warn("Error restarting context " + context.getName() + " " +
  +                    e.toString());
               result = false;
           }
           return result;
  
  
  

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