I have to deploy a war file named abc.war to tomcat 6.0.18 on RHEL 4.6 with no restarting (if possible) of tomcat service (due other applications running on same machine).
I copied abc.war file to webapps directory using shell script. Tomcat auto deploy abc.war and make abc folder so i can access application via
http://_Server_ip_/abc
If I need to update application abc with new abc.war I'm stuck in a lot of cases as hot auto deploy don't work and i need to restart tomcat to make it work.
I upgraded script with option to delete old abc.war file from webapps and wait 30 seconds (should i wait more?) for tomcat to remove abc folder before copying new abc.war file. If there is no removal of abc folder (by tomcat) i delete it before copying new war file. After copy of new abc.war file I wait for auto deploy.
In most cases i need to restart tomcat for deploying (making abc folder).
Sometimes deploy works, but i got 404 while accessing the application and i need to restart tomcat anyway.
I noticed there is a $CATALINA_HOME/work/localhost/abc folder and in $CATALINA_HOME/conf/localost/abc.xml (I'm writing names and location from my head so there might be a slightly different folder names). I wonder should i delete them too before copying new war file? Should i add some sleep timer before copying new war file?
Maybe I'm doing something wrong?
Please advice me, how to proceed to make upgrades more robust without so many restarts.