Win a copy of Grokking Bitcoin this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

Tomcat can't find JAR after redeploy  RSS feed

 
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am updating an application to the newest version of Struts.  I deploy the application to Tomat 9.0.8 by copying the WAR file into the $TOMCAT_HOME/webapps directory.  When the application redeploys, Tomcat displays an error:


The weird thing is, the 1-physician directory is the temp directory for the old version of the application. If I look in that directory, most of the application files have been deleted except web/WEB-INF/lib, which contains all the dependency JAR files except for that one.  There will be a new temp directory, in this case, 3-physician, created for the new deployment with all the application files.
After this, the application throws a bunch of exceptions if I try to access pages:


I have to restart Tomcat to get the application to run again.  Deploying the application in this way was never an issue before.  Any ideas as to why now?
 
Saloon Keeper
Posts: 20643
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Up until about the middle of the Tomcat 8 releases, copying a WAR into TOMCAT_HOME/webapps when a webapp of the same name was already deployed via exploding would cause the new WAR to be ignored and the existing webapp in the webapps subdirectory with the same name as the WAR to continue to be used. After that point, supposedly things changed and now you're (theoretically) able to deploy a new version of a webapp just by copying a WAR.

In any event, hot-deploy on Tomcat has been dicey for a very long time, so the safest approach is to terminate Tomcat, delete all the files/subdirectories in the Tomcat work, temp, logs, and webapps directories that are related to that webapp, copy in the WAR to the webapps directory and restart Tomcat.

This is all based on the default cases. If you have a deployment descriptor in TOMCAT_HOME/conf/Catalina/localhost pointing to some other location for the webapp code, if you have auto-explosion turned off, or certain other non-default options set, your results may vary.
 
Joe Ess
Bartender
Posts: 9559
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for confirming my suspicions, Tim.
 
Stinging nettles are edible. But I really want to see you try to eat this tiny ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!