Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
  • 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
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
Sheriffs:
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
Bartenders:
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

Tomcat can't find JAR after redeploy  RSS feed

 
Bartender
Posts: 9550
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?
 
Bartender
Posts: 20124
103
Android Eclipse IDE Linux
  • 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: 9550
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for confirming my suspicions, Tim.
 
it's a teeny, tiny, wafer thin ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!