Search code examples
tomcat

Tomcat loads and old version of .war


I have a tomcat app that was working without problems for months. But suddely (I dont know why) it started to fail. Why? It loads and old version of this app. I created a new .war, I reinstall tomcat but is still loading the old version.

How can I solve it?


Solution

  • Tomcat will only run what you give it: it won't resurrect phantom .war files.

    Per your comments, the Tomcat is not in a production environment - everything's apparently all on your workstation. So Jenkins (or equivalent) isn't an issue.

    SUGGESTION:

    1. Create a brand new workspace:

    Eclipse > File > Switch Workspace > Other > "workspace-new"

    1. Create a new server:

    Eclipse > Window > Show View > Server > Servers > Define a new Server

    • Use your existing Tomcat, but create a new Eclipse instance
    • Tomcat instances are per-workspace.

    For example, your new instance might be under

     %USERPROFILE%\workspace-new\.metadata\.plugins\org.eclipse.wst.server.core\tmp1\wtpwebapps
    
    1. Import your project

    Eclipse > File > Import > Import existing project ...

    1. Build and execute

    You should NOT see an "old version".