5
votes

I am new to Tomcat and following is the steps I am using to update a .war in Tomcat:

  1. stop tomcat.
  2. delete .war and the folder with same name in /webapps.
  3. copy and paste my new .war in /webapps.
  4. restart tomcat by ./bin/catalina.sh run.

However, the new .war always won't work. Seems it's the old version .war that is running.

In /conf/server.xml, I am using the following configs:

  <Host name="localhost"  appBase="webapps" unpackWARs="true" autoDeploy="true">

Can someone help me on this problem? Thanks!

2
Clean out your old stuff from the /work folder, too.duffymo
The tomact and his deamon should run to redeploy a web app.Simply replace the old war with the new one.and add autoDeploy to the server.xmlZelldon
Try out PsiProbe. Its an opensource Tomcat manager that lets you change apps without restarting the server.Stefan

2 Answers

8
votes

Replacing the old war file with a new one should work fine. You don't need to delete the old one, just overwrite it.

If you don't want to restart the server you could set <Context reloadable="true"> in context.xml file.

Better yet, I'd suggest you use Tomcat Manager to deploy without shutting down Tomcat. Hope this helps.

1
votes

What I usually do is go to the tomcat admin page (e.g. http://localhost:8080/) (assuming port is 8080 and the tomcat is hosted on the same server). Click on 'Manager App'. Scroll below and you would see a section 'War file to Deploy'. Browse the war file and click on 'Deploy'.

Note: Credentials will be asked when you click on 'Manager App' button. In this case check the conf/tomcat-users.xml file and make the following entry within <tomcat-users> element:

<user username="admin" password="admin" roles="manager-gui" />

After this you can login with admin/admin.