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

前端 未结 10 982
忘掉有多难
忘掉有多难 2020-12-09 14:43

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

相关标签:
10条回答
  • 2020-12-09 15:33

    I had the same issue twice, but in the second time I realized it wasn't a problem on Tomcat at all.. Try to delete the cache of your browser, refresh the page and see if the new version of the page on your server is being shown up. It worked with me.

    0 讨论(0)
  • 2020-12-09 15:38

    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.

    0 讨论(0)
  • 2020-12-09 15:40

    You can delete the "work" directory.

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

    0 讨论(0)
  • 2020-12-09 15:40

    Sounds like your class loader is not loading the servlet classes once they are updated. This might be fixed if you change your web.xml file which should prompt the server/container to re-deploy and reload the servlet classes. I guess add an empty line at the end of your web.xml and save it and then see if that fixes it. As i said this might fix it or might not.

    Good luck!

    0 讨论(0)
提交回复
热议问题