2

I am using Tomcat 7.0 for my web application deployment ... Still now i used to stop the server and delete the old war file and paste the new war file and then start the server ... Now I heard about hot deployment service and willing to do hot deployment for my website ... I searched various questions in stack overflow and tried according to the answers but its not working .. I have a war file as adweb.war and made some updates and produce the same adweb.war to be overwritten in the WebApps folder ... How can I do that ? Pls answer in simple steps so that I can easily understand .. Pls dont mark this as duplicate because I wrote this question as there is insufficient answers in this topic and some answers are there which are very complicated to understand for beginners like me . So I hope this question will help beginners like me ...

Ree
  • 141
  • 1
  • 4
  • 15
  • 1
    Are you asking how to copy a file? If not, you should rephrase your question to make it obvious what you're actually asking about. – jarnbjo Apr 24 '13 at 12:52
  • @jarnbjo I copied the war file and paste it in webapps folder ..a window opens on do u want to overwrite existing file ... i click yes for do u want to overwrite existing file ... then i refreshed the webpage .. it throwing 404 error – Ree Apr 24 '13 at 13:14
  • possible duplicate of [Tomcat Hot Deploy](http://stackoverflow.com/questions/7885551/tomcat-hot-deploy) – Lukas Knuth Apr 24 '13 at 22:38
  • @LukasKnuth have u seen any valid answer in the page u marked as original ... people like u are there to mark only as duplicate ... if possible tell me the answer or else mind ur own business – Ree Apr 25 '13 at 06:17

3 Answers3

3

With Tomcat 7, the task of updating wars without taking down the tomcat is easier. There are multiple ways to do this.

I would suggest you to follow either one of the below:

  1. Use Tomcat Manager GUI
  2. Using ANT based Deployment using Tomcat's Deploy task.

In any of these cases, you would need to rename your war file, from adweb.war to adweb##.war, and context.xml (if needed) and upload to a remote/local tomcat setup.

Everytime you need to upgrade your war, just use a higher version number than the previous one while renaming the war file.

Note that, the context path /adweb should also be updated as /adweb## while performing hot deployment.

Once, the new version is successfully deployed (indicated in the manager UI), you can stop/undeploy the previous version. If not, the tomcat will still use the latest version and all the new requests will be redirected to the new version.

Manu
  • 51
  • 7
  • is there any way to override the old war file with the new one? In the test environment, it's frustrating to clean all the old war files from time to time. – Ajithkumar_sekar Aug 22 '18 at 05:59
2

My answer is not perfect but it can be used as a way around. While your tomcat is running delete the existing war file and then paste your current war file and after few seconds you can see on the console that your war has been deployed.

Hope this helps

Roy
  • 1,231
  • 1
  • 24
  • 61
0

Not Sure wether this link will be suit for your requirement or not.But you will get some information on hot deployment check this hot deployment tomcat

Vasu
  • 149
  • 7