tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hari...@hyperreal.org
Subject cvs commit: jakarta-tomcat/src/shell tomcat.sh
Date Fri, 03 Dec 1999 17:01:26 GMT
harishp     99/12/03 09:01:26

  Modified:    .        build.sh
               src/share/org/apache/tomcat/service TcpEndpoint.java
               src/share/org/apache/tomcat/shell Startup.java
               src/shell tomcat.sh
  Log:
  Some build script & other startup cleanups.
  
  Revision  Changes    Path
  1.4       +17 -3     jakarta-tomcat/build.sh
  
  Index: build.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/build.sh,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- build.sh	1999/11/28 23:52:29	1.3
  +++ build.sh	1999/12/03 17:01:15	1.4
  @@ -1,9 +1,23 @@
   #! /bin/sh
   
  -# $Id: build.sh,v 1.3 1999/11/28 23:52:29 harishp Exp $
  +# $Id: build.sh,v 1.4 1999/12/03 17:01:15 harishp Exp $
   
  -cp=../jakarta-tools/ant.jar:../jakarta-tools/projectx-tr2.jar:../build/tomcat/classes
  +if [ -z "$JAVA_HOME" ]
  +then
  +JAVACMD=`which java`
  +if [ -z "$JAVACMD" ]
  +then
  +echo "Cannot find JAVA. Please set your PATH."
  +exit 1
  +fi
  +JAVA_BINDIR=`dirname $JAVACMD`
  +JAVA_HOME=$JAVA_BINDIR/..
  +fi
   
  -java -classpath $cp:$CLASSPATH org.apache.tools.ant.Main "$@"
  +JAVACMD=$JAVA_HOME/bin/java
  +
  +cp=../jakarta-tools/ant.jar:../jakarta-tools/projectx-tr2.jar:../build/tomcat/classes:$JAVA_HOME/lib/tools.jar
  +
  +$JAVACMD -classpath $cp:$CLASSPATH org.apache.tools.ant.Main "$@"
   
   chmod +x `find ../build -name "*.sh"`
  
  
  
  1.4       +8 -6      jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java
  
  Index: TcpEndpoint.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- TcpEndpoint.java	1999/10/28 16:57:43	1.3
  +++ TcpEndpoint.java	1999/12/03 17:01:19	1.4
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
1.3 1999/10/28 16:57:43 costin Exp $
  - * $Revision: 1.3 $
  - * $Date: 1999/10/28 16:57:43 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/TcpEndpoint.java,v
1.4 1999/12/03 17:01:19 harishp Exp $
  + * $Revision: 1.4 $
  + * $Date: 1999/12/03 17:01:19 $
    *
    * ====================================================================
    *
  @@ -183,7 +183,7 @@
   
       // -------------------- Public methods --------------------
       
  -    public void startEndpoint() {
  +    public void startEndpoint() throws IOException, InstantiationException {
   	try {
   	    if(factory==null)
   		factory=ServerSocketFactory.getDefault();
  @@ -196,13 +196,15 @@
   	    }
   	} catch( IOException ex ) {
   	    // throw?
  -	    ex.printStackTrace();
  +	    // ex.printStackTrace();
   	    running=false;
  +            throw ex;
   	    //	    throw new HttpServerException(msg);
   	} catch( InstantiationException ex1 ) {
   	    // throw?
  -	    ex1.printStackTrace();
  +	    // ex1.printStackTrace();
   	    running=false;
  +            throw ex1;
   	    //	    throw new HttpServerException(msg);
   	}
   	running=true;
  
  
  
  1.6       +11 -7     jakarta-tomcat/src/share/org/apache/tomcat/shell/Startup.java
  
  Index: Startup.java
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Startup.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Startup.java	1999/10/30 00:29:31	1.5
  +++ Startup.java	1999/12/03 17:01:21	1.6
  @@ -1,7 +1,7 @@
   /*
  - * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Startup.java,v 1.5
1999/10/30 00:29:31 costin Exp $
  - * $Revision: 1.5 $
  - * $Date: 1999/10/30 00:29:31 $
  + * $Header: /home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/shell/Startup.java,v 1.6
1999/12/03 17:01:21 harishp Exp $
  + * $Revision: 1.6 $
  + * $Date: 1999/12/03 17:01:21 $
    *
    * ====================================================================
    *
  @@ -116,8 +116,8 @@
   	checkClassDependencies();
   
   	ServerConfig serverConfig = config.getServerConfig();
  -	Registry registry =  createRegistry(serverConfig.getAdminPort());
   
  +        Registry registry= createRegistry(serverConfig.getAdminPort());
   	Enumeration contextManagers = serverConfig.getContextManagers();
   
   	while (contextManagers.hasMoreElements()) {
  @@ -209,6 +209,7 @@
   
   	        System.out.println(msg);
   		hse.printStackTrace();
  +                throw new StartupException();
   		// "problem starting server" can't help
   		// the user detect that the port is taken.
   		// ( or another tcp-related problem )
  @@ -219,15 +220,17 @@
   
   	        System.out.println(msg);
   		re.printStackTrace();
  +                throw new StartupException();
   		// The original message is useless,
  -		// I had no ideea what to do - if we can't figure a better
  +		// I had no idea what to do - if we can't figure a better
   		// message, please let the stack trace in
   
   		// in my case - I had no eth card, and it couldn't find the hostname
   	    } catch (AlreadyBoundException abe) {
   	        String msg = sm.getString("startup.server.abe");
  -
   	        System.out.println(msg);
  +		abe.printStackTrace();
  +                throw new StartupException();
   	    }
   	}
       }
  @@ -351,7 +354,8 @@
   
   	    start.configure(args);
   	} catch (StartupException e) {
  -	    System.out.println(e.getMessage());
  +	    // System.out.println(e.getMessage());
  +            System.exit(1);
   	}
       }
   
  
  
  
  1.3       +17 -3     jakarta-tomcat/src/shell/tomcat.sh
  
  Index: tomcat.sh
  ===================================================================
  RCS file: /home/cvs/jakarta-tomcat/src/shell/tomcat.sh,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- tomcat.sh	1999/11/28 23:52:32	1.2
  +++ tomcat.sh	1999/12/03 17:01:24	1.3
  @@ -1,6 +1,6 @@
   #!/bin/sh
   #
  -# $Id: tomcat.sh,v 1.2 1999/11/28 23:52:32 harishp Exp $
  +# $Id: tomcat.sh,v 1.3 1999/12/03 17:01:24 harishp Exp $
   
   # Shell script to start and stop the server
   
  @@ -14,6 +14,20 @@
   
   baseDir=`dirname $0`
   
  +if [ -z "$JAVA_HOME" ]
  +then
  +JAVACMD=`which java`
  +if [ -z "$JAVACMD" ]
  +then
  +echo "Cannot find JAVA. Please set your PATH."
  +exit 1
  +fi
  +JAVA_BINDIR=`dirname $JAVACMD`
  +JAVA_HOME=$JAVA_BINDIR/..
  +fi
  +
  +JAVACMD=$JAVA_HOME/bin/java
  +
   jsdkJars=${baseDir}/webserver.jar:${baseDir}/lib/servlet.jar
   jspJars=${baseDir}/lib/jasper.jar
   beanJars=${baseDir}/webpages/WEB-INF/classes/jsp/beans
  @@ -48,12 +62,12 @@
   then 
   shift 
   echo Using classpath: ${CLASSPATH}
  -java org.apache.tomcat.shell.Startup "$@" &
  +$JAVACMD org.apache.tomcat.shell.Startup "$@" &
   elif test "$1" = "stop"
   then 
   shift 
   echo Using classpath: ${CLASSPATH}
  -java org.apache.tomcat.shell.Shutdown "$@"
  +$JAVACMD org.apache.tomcat.shell.Shutdown "$@"
   else
   echo "Usage:"
   echo "tomcat [start|stop]"
  
  
  

Mime
View raw message