Incomplete WAR explosion upon hot deployment in Tomcat


Web tier: servlets, JSP, Web frameworks: Incomplete WAR explosion upon hot deployment in Tomcat

  1. I'm developing a Spring MVC and Hibernate application and deploying it on Tomcat 5.5 running on a Windows XP machine.

    I'm building and deploying the WAR for this application using Ant, which is being run from Eclipse. When the WAR is deployed to $TOMCAT_HOME/webapps it fails to explode properly, and all that is left in my application's directory after redeploy is WEB-INF/lib/ehcache-1.1.jar. However if I stop Tomcat, remove the application directory (but not the WAR), and then restart Tomcat then the WAR is properly exploded and all files and libraries are where they should be. This works for now, but I'd like to be able to redeploy my WAR without having to stop Tomcat, remove the original application directory, and then restart Tomcat every time I have a new WAR. This sort of "hot deployment" is possible with Tomcat, right?

    Thanks in advance for any suggestions or insight.

  2. This looks like a bug. Try using an older version of Tomcat and.

  3. Same problem here with same environment and latest Tomcat 5.5 build. After stopping and undeploying the application from Tomcat Manager the ehcache-1.1.jar file is left in the WEB-INF/lib directory. The file appears to be locked by Tomcat and cannot be deleted in Windows Explorer until Tomcat is restarted. This also prevents subsequent deployment as described in first message of this thread.
  4. Solution to HOT WAR Redeployment[ Go to top ]

    I found a solution posted here:

    If you try to hot-deploy a WAR file to Tomcat on Windows, you often encounter file locking issues. Windows won’t let Tomcat undeploy the old app because files are locked by the OS. Here is a fix:

    Edit %CATALINA_HOME%\conf\context.xml. Find the root <Context> and add these two attributes:

    <Context antiJARLocking="true" antiResourceLocking="true">

    Now you can copy updated WAR files to your deploy directory and Tomcat will remove the old app and hot-deploy your new app. I’m using this on Tomcat 5.5.11 without any trouble.