|
From: David R. <dre...@mo...> - 2003-06-12 09:40:53
|
Hi all, I've made a few changes to WrapperStartStopApp, making it so that startup will not finish until all webapps specified have started. This is helpful because often Tomcat has no problem starting and staying up, while the servlet (that is the reason for starting Tomcat) doesn't start successfully. WrapperWebappStart uses the Tomcat manager webapp to "list" all running contexts on Tomcat, so the manager webapp has to be set up in order for WrapperWebappStart to work. Setup is easy; all parameters are identical to WrapperStartStopApp with the following additions: ------------------start conf------------------ ############ These are all the same as before (included for clarity) ############=20 # The first application parameter is the name of the class whose main # method is to be called when the application is launched. The class # name is followed by the number of parameters to be passed to its main # method. Then comes the actual parameters. wrapper.app.parameter.1=3Dorg.apache.catalina.startup.Bootstrap wrapper.app.parameter.2=3D1 wrapper.app.parameter.3=3Dstart # The start parameters are followed by the name of the class whose main # method is to be called to stop the application. The stop class name # is followed by a flag which controls whether or not the Wrapper should # wait for all non daemon threads to complete before exiting the JVM. # The flag is followed by the number of parameters to be passed to the # stop class's main method. Finally comes the actual parameters. wrapper.app.parameter.4=3Dorg.apache.catalina.startup.Bootstrap wrapper.app.parameter.5=3Dfalse wrapper.app.parameter.6=3D1 wrapper.app.parameter.7=3Dstop ############ Start of new parameters ############=20 # These parameters are used to make sure webapps listed start # when Tomcat is started. # URL of Tomcat manager webapp wrapper.app.parameter.8=3Dhttp://localhost:8080/manager # Username for authentication in Tomcat manager webapp wrapper.app.parameter.9=3Dusername # Password for authentication in Tomcat manager webapp wrapper.app.parameter.10=3Dpassword # The number of webapps to wait for wrapper.app.parameter.11=3D1 # Names of actual webapps to wait for wrapper.app.parameter.12=3D/main ############ End of new parameters ############=20 ------------------end conf------------------ In addition to wrapper.jar, you will also need to add xerces.jar to the classpath. Tomcat 4.1.X has a copy of it at %CATALINA_HOME%/shared/lib/xerces.jar. I also needed to increase the time needed for the service to start, using wrapper.startup.timeout=3D90. I hope that someone else finds this useful! David Resnick MobileSpear Inc. |