• 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
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

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?
 
Something about .... going for a swim. With this tiny ad ...
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic