I am new to Tomcat and following is the steps I am using to update a .war in Tomcat:
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!
Perhaps the simplest way to deploy a WAR file to Tomcat is to copy the file to Tomcat's webapps directory. Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With