• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Advice on deploying WAR file

 
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I am wondering if someone could provide advice on the correct way to re-deploy a WAR file to Tomcat. I am running version 4.1.31.
Currently to deploy a WAR file I simply copy the WAR file to the <TOMCAT_HOME>\webApps directory. Then when I startup Tomcat the WAR file gets exploded. This all seems to work fine.
But how about if I want to re-deploy a new version of the WAR file? Do I have to delete the WAR file from <TOMCAT_HOME>\webApps AND from <TOMCAT_HOME>\webApps\<context_name>? Or do I just overwrite the WAR file in <TOMCAT_HOME>\webApps?
I have had some problems on startup in the past when I directly deleted the actual application context folder - <TOMCAT_HOME>\webApps\<context_name>.
Thanks!
 
Ranch Hand
Posts: 405
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, you can go thru the motions of deleting the old war file and the directory that was created. Of course you will have to shutdown/restart TOMCAT everytime that is done.

I usually just use the manager status web interface to redeploy the application after I place the new WAR file in the ../webapps directory.
 
Andy Hahn
Ranch Hand
Posts: 225
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I would like to go the route of deleting the WAR file and restarting Tomcat (however I will check out the manager status web interface for my home projects!).

The problem I am having occurs when I delete the <TOMCAT_HOME>\webApps\<context_name> directory.
Tomcat throws exceptions and will not start when I do this. I have found that this is because that application's context information is added to server.xml.
Also, the application context is copied to <TOMCAT_HOME>\work\Standalone\localhost\<context_name>.

So with all of that said, would it be ok to simply delete the WAR file from <TOMCAT_HOME>\webApps and leave <TOMCAT_HOME>\webApps\<context_name> undeleted?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic