tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From billbar...@apache.org
Subject cvs commit: jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup Catalina.java
Date Thu, 25 Sep 2003 03:08:56 GMT
billbarker    2003/09/24 20:08:56

  Modified:    catalina/src/share/org/apache/catalina/startup Catalina.java
  Log:
  Prevent clobbering the server if we already have read server.xml.
  
  This can happen, for example, if you are running Tomcat from procrun with the in-process
option.
  
  Fix for bug #23373
  Reported By: David Oxley dave@junglemoss.com
  
  Revision  Changes    Path
  1.21      +22 -20    jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java
  
  Index: Catalina.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Catalina.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- Catalina.java	28 Jul 2003 11:14:48 -0000	1.20
  +++ Catalina.java	25 Sep 2003 03:08:56 -0000	1.21
  @@ -410,22 +410,24 @@
   
       public void stopServer() {
   
  -        // Create and execute our Digester
  -        Digester digester = createStopDigester();
  -        digester.setClassLoader(Thread.currentThread().getContextClassLoader());
  -        File file = configFile();
  -        try {
  -            InputSource is =
  -                new InputSource("file://" + file.getAbsolutePath());
  -            FileInputStream fis = new FileInputStream(file);
  -            is.setByteStream(fis);
  -            digester.push(this);
  -            digester.parse(is);
  -            fis.close();
  -        } catch (Exception e) {
  -            System.out.println("Catalina.stop: " + e);
  -            e.printStackTrace(System.out);
  -            System.exit(1);
  +        if( server == null ) {
  +            // Create and execute our Digester
  +            Digester digester = createStopDigester();
  +            digester.setClassLoader(Thread.currentThread().getContextClassLoader());
  +            File file = configFile();
  +            try {
  +                InputSource is =
  +                    new InputSource("file://" + file.getAbsolutePath());
  +                FileInputStream fis = new FileInputStream(file);
  +                is.setByteStream(fis);
  +                digester.push(this);
  +                digester.parse(is);
  +                fis.close();
  +            } catch (Exception e) {
  +                System.out.println("Catalina.stop: " + e);
  +                e.printStackTrace(System.out);
  +                System.exit(1);
  +            }
           }
   
           // Stop the existing server
  
  
  

Mime
View raw message