Return-Path: Delivered-To: apmail-jakarta-tomcat-dev-archive@jakarta.apache.org Received: (qmail 79929 invoked by uid 500); 11 Sep 2001 20:32:50 -0000 Mailing-List: contact tomcat-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: tomcat-dev@jakarta.apache.org Delivered-To: mailing list tomcat-dev@jakarta.apache.org Received: (qmail 79920 invoked by uid 500); 11 Sep 2001 20:32:50 -0000 Delivered-To: apmail-jakarta-tomcat-4.0-cvs@apache.org Date: 11 Sep 2001 20:28:41 -0000 Message-ID: <20010911202841.95773.qmail@icarus.apache.org> From: craigmcc@apache.org To: jakarta-tomcat-4.0-cvs@apache.org Subject: cvs commit: jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup Embedded.java X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N craigmcc 01/09/11 13:28:41 Modified: catalina/src/share/org/apache/catalina/startup Embedded.java Log: Modify the org.apache.catalina.startup.Embedded class to *require* that the "catalina.home" system property be set in order to function. Many internal Catalina operations depend on this. Modify the org.apache.catalina.startup.Embedded class to copy the value of the "catalina.home" system property to the "catalina.base" system property if the latter is not set. Many internal Catalina operations depend on this. Add a backwards-compatibility patch so that the most recent Tomcat 4.0 code will still run with the J2EE 1.3 Reference Implementation. Revision Changes Path 1.11 +29 -4 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java Index: Embedded.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -r1.10 -r1.11 --- Embedded.java 2001/07/24 22:48:31 1.10 +++ Embedded.java 2001/09/11 20:28:41 1.11 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v 1.10 2001/07/24 22:48:31 pier Exp $ - * $Revision: 1.10 $ - * $Date: 2001/07/24 22:48:31 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Embedded.java,v 1.11 2001/09/11 20:28:41 craigmcc Exp $ + * $Revision: 1.11 $ + * $Date: 2001/09/11 20:28:41 $ * * ==================================================================== * @@ -148,7 +148,7 @@ * * * @author Craig R. McClanahan - * @version $Revision: 1.10 $ $Date: 2001/07/24 22:48:31 $ + * @version $Revision: 1.11 $ $Date: 2001/09/11 20:28:41 $ */ public class Embedded implements Lifecycle { @@ -911,6 +911,22 @@ if (debug >= 1) logger.log("Starting embedded server"); + // Validate the setup of our required system properties + if (System.getProperty("catalina.home") == null) { + // Backwards compatibility patch for J2EE RI 1.3 + String j2eeHome = System.getProperty("com.sun.enterprise.home"); + if (j2eeHome != null) + System.setProperty + ("catalina.home", + System.getProperty("com.sun.enterprise.home")); + else + throw new LifecycleException + ("Must set 'catalina.home' system property"); + } + if (System.getProperty("catalina.base") == null) + System.setProperty("catalina.base", + System.getProperty("catalina.home")); + // Validate and update our current component state if (started) throw new LifecycleException @@ -1009,6 +1025,15 @@ embedded.setDebug(5); embedded.setLogger(new SystemOutLogger()); String home = System.getProperty("catalina.home"); + if (home == null) { + System.err.println("You must set the 'catalina.home' system property"); + System.exit(1); + } + String base = System.getProperty("catalina.base"); + if (base == null) { + base = home; + System.setProperty("catalina.base", base); + } // Start up this embedded server (to prove we can dynamically // add and remove containers and connectors later)