0

I want to setup an update process for an application running on Tomcat. The server which hosts tomcat is only open during working hours (it is an intraner application for a small company). I was thinking that I could upload the new war to the server and set up "something" to run on the next server boot. This something could be a bat file that will be executed on server start up but before the start up of the Tomcat service and it will delete the old war and its exploded folder. When I update manually the war I also delete the work folder of Tomcat (just to be sure). I know about hot deployment but I do not consider it an option since I am not very sure for the implications it might have on the users current working sessions.

Is there a way to run such a bat file before Tomcat start up or an alternative way to do this update? Tomcat version isn't an issue. Now is running Tomcat 6 but I can upgrade to version 7 if needed.

1 Answer 1

0

The way I would set it up is by not having tomcat auto start on start up of the server but simply call the startup.bat/.sh file (located in the tomcat/bin folder) at the end of the script that replaces the war file (and that is run at startup of the server).

2
  • You may have a point. Since I want to run Tomcat the proper way as a service, I could disable the automatic start up of the service when I upload the war and then in the end of the script I could start the service and reset it to automatic.
    – pater
    Apr 12, 2012 at 10:55
  • Or keep tomcat as a service, have the script that replaces the war file and then restart tomcat (that will cause tomcat to re-read the war file and re-deploy it). I have cheated that way once or twice when re-uploading updated war files (or a new ROOT app)
    – Jontas
    Apr 12, 2012 at 11:18

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .