remm 02/04/15 02:34:06 Modified: catalina/src/share/org/apache/catalina/startup Catalina.java Log: - This should allow running Tomcat with JDK 1.2 again (however, 1.3 is required to build). Revision Changes Path 1.46 +19 -9 jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java Index: Catalina.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v retrieving revision 1.45 retrieving revision 1.46 diff -u -r1.45 -r1.46 --- Catalina.java 27 Dec 2001 12:33:07 -0000 1.45 +++ Catalina.java 15 Apr 2002 09:34:06 -0000 1.46 @@ -1,7 +1,7 @@ /* - * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.45 2001/12/27 12:33:07 glenn Exp $ - * $Revision: 1.45 $ - * $Date: 2001/12/27 12:33:07 $ + * $Header: /home/cvs/jakarta-tomcat-4.0/catalina/src/share/org/apache/catalina/startup/Catalina.java,v 1.46 2002/04/15 09:34:06 remm Exp $ + * $Revision: 1.46 $ + * $Date: 2002/04/15 09:34:06 $ * * ==================================================================== * @@ -97,7 +97,7 @@ * </u> * * @author Craig R. McClanahan - * @version $Revision: 1.45 $ $Date: 2001/12/27 12:33:07 $ + * @version $Revision: 1.46 $ $Date: 2002/04/15 09:34:06 $ */ public class Catalina { @@ -495,8 +495,13 @@ try { server.initialize(); ((Lifecycle) server).start(); - // Register shutdown hook - Runtime.getRuntime().addShutdownHook(shutdownHook); + try { + // Register shutdown hook + Runtime.getRuntime().addShutdownHook(shutdownHook); + } catch (Throwable t) { + // This will fail on JDK 1.2. Ignoring, as Tomcat can run + // fine without the shutdown hook. + } // Wait for the server to be told to shut down server.await(); } catch (LifecycleException e) { @@ -512,9 +517,14 @@ // Shut down the server if (server instanceof Lifecycle) { try { - // Remove the ShutdownHook first so that server.stop() doesn't - // get invoked twice - Runtime.getRuntime().removeShutdownHook(shutdownHook); + try { + // Remove the ShutdownHook first so that server.stop() + // doesn't get invoked twice + Runtime.getRuntime().removeShutdownHook(shutdownHook); + } catch (Throwable t) { + // This will fail on JDK 1.2. Ignoring, as Tomcat can run + // fine without the shutdown hook. + } ((Lifecycle) server).stop(); } catch (LifecycleException e) { System.out.println("Catalina.stop: " + e);
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>