As a workaround/kludge, could you have your tomcat startup scripts use the 
database command line tool to query the database and if it fails or doesn't 
return something reasonable, have it in a loop that sleeps for 5 or so seconds 
and then tries again?


Nathan Aaron wrote:
I am using Tomcat 6.0.18 and jdk1.6.0_12. I apologize for not posting that in the beginning.

I deploy several applications using one instance of Tomcat. The Application uses a database that resides on a separate server. When these servers are rebooted I would prefer that Tomcat start on server A. Then on server B, the database startup script can just make a call to start the context. If I don't do it this way Tomcat will start and start all the contexts. If the database is not available they will fail to start.

Thanks,
Nathan

Caldarale, Charles R wrote:
From: Nathan Aaron [mailto:naa...@glenraven.com]
Subject: Re: tomcat startup

<Host name="localhost" appBase="webapps"
unpackWARs="true" autoDeploy="true" deployXML="true"
xmlValidation="false" xmlNamespaceAware="false"
deployOnStartup="false">

This had no effect. All the contexts started when Tomcat started.

I don't think they did - at least they didn't in my testing with 6.0.18. However, ten seconds *after* Tomcat started, the autoDeploy monitor kicked in, and that did deploy all the webapps. I tried setting autoDeploy to false as well, restarted Tomcat, and then nothing deployed - ever. Nor could I figure out a way to deploy anything manually, since the manager webapp wasn't deployed (catch-22).

One way around this is to keep your webapps in some directory other than the one pointed to by the <Host> appBase and deploy them by placing a <Context> element with the appropriate docBase setting in conf/Catalina/[host]/[appName].xml when you want the associated webapp to start. Your Tomcat shutdown script would then remove all such files to prevent their automatic redeployment on the next Tomcat startup.

But let's back up one step from the original question: why do you not want the webapps to deploy when Tomcat starts?

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to