How to purge tomcat's cache when deploying a new .war file? Is there a config setting?


I have a simple hello, world servlet application that I am just playing around with, and pushing it out to my tomcat server on a VPS.

When I make a change to my code, and deploy it, tomcat doesn't serve the newly published code (even after starting the service again).

I stop the service, then push the new war file to /webapps/, and I make sure to delete the old exploded folder also.

When I re-start the server, it still serves the older codebase.

Is there a setting in the config to stop this behaviour?

Also, what folders would I have to delete? Please be specific (folders and paths) as I have tried deleting some and havent' gotten anywhere.

This question is tagged with java tomcat

~ Asked on 2011-11-02 01:35:30

The Best Answer is


You can delete the "work" directory.

Are you sure it's not a browser caching issue?

~ Answered on 2011-11-02 01:44:52


I'd add that in case of really odd behavior - where you spend a couple of hours saying WTF - try manually deleting the /webapps/yourwebapp/WEB-INF/classes directory. A java source file that was moved to another package will not have its compiled class file deleted - at least in the case of an exploded web-application on TC. This can seriously drive you crazy with unpredictable behavior, especially with an annotated servlet.

~ Answered on 2013-12-23 18:21:59

Most Viewed Questions: