Issue: I had deployed latest war file of my Java project into tomcat’s webapps folder but I could not see any changes reflected while running my project.
What I tried?
It looked like war file must not have been uploaded properly. So, I stopped the tomcat server, deleted the deployed war file, uploaded the war file again and restarted tomcat server. But this also did not help.
Solution: Clear the Tomcat Cache files.
Windows:
1. Stop the Tomcat service.
2. Delete the folder named “Catalina” in your work folder. The default location for this folder is:
C:\program files\tomcat\work
3. Start the Tomcat service. The work folder will automatically be recreated.
Linux:
1. Stop the Tomcat service. This can be done at the terminal with the command:
service tomcat stop
2. Delete the contents of the directory named “Catalina” in your work directory. The default path is:
/opt/tomcat/work/
or
/usr/local/tomcat/work/
3. Start the Tomcat service. This can be done (by default) at the terminal with the command:
service tomcat start
Description: Apache Tomcat automatically creates cache files for every page it serves. When we run our project, it is actually the cache files that is executed. Sometimes it is necessary to delete this cache as it does not replaces the files with the newer one. Once deleted, Tomcat will automatically rebuild the cache files.