2
votes

I have a simple hello world java application I deployed, and in the new code I changed the output of the servlet to print some statements in a loop.

It works fine locally.

I uploaded the new .war file, stopped tomcat, deleted the old .war file in /webapps and the exploded folder.

Then I copied the new .war file, and then restarted tomcat.

It exploded the folder, but somehow the code is old.

Could it be caching the .war file somehow?

I did change server.xml and set autodeploy=false but not sure if that is relevant?

2

2 Answers

4
votes

delete the work directory and restart tomcat.

Bit too terse sorry. Tomcat will turn jsp into servlet source before compiling, some caching takes place in the work directory this may be what is causing it to happen.

It has been some time since I used Tomcat but I am fairly sure the structure was something like work/host/engine/context so you will probably find your stuff under work/localhost/Catalina/--web context--

1
votes

I did change server.xml and set autodeploy=false but not sure if that is relevant?

oO.

From the docs

This flag value indicates if new web applications, dropped in to the appBase directory while Tomcat is running, should be automatically deployed. The flag's value defaults to true. See Automatic Application Deployment for more information.

I'd start there.