• 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

deleting war file from tomcat

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
after deleting the WAR file while Tomcat is running, then Tomcat not deleting the complete web app directory on linux server.
for ex. if i delete amol.war then amol dirctory still remains
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why did you expect Tomcat to delete the directory automatically?

Bill
 
Ranch Hand
Posts: 56
Netbeans IDE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Amol Dongre wrote:after deleting the WAR file while Tomcat is running, then Tomcat not deleting the complete web app directory on linux server.
for ex. if i delete amol.war then amol dirctory still remains



I really dont understand what you are expecting from tomcat ?

WebContent folder is a must for a web application (or) a web project.

If are trying to remove unwanted wars from your project then, go to WebContent/WEB-INF/lib and then delete the WAR ! then build your project again.


 
Sheriff
Posts: 67748
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sachin Pachari wrote:WebContent folder is a must for a web application (or) a web project.


It most certainly is not.

What folder the contexts go in does not matter to Tomcat, which by default uses webapps. "WebContent" is just an artifact of your IDE and nothing more.
 
Sachin Pachari
Ranch Hand
Posts: 56
Netbeans IDE Eclipse IDE Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok My Bad ! i may Have put it wrongly, but what i ment was, for a War deployment, the contents inside the WebContent folder are important, if you delete the WebContent folder then the IDE Has nothing to Deploy.
 
Amol Dongre
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
when we deploy war. file on tomcat it creates directory for that file automatically. so when i delete same war file from tomcat it should delete directory automaticallt. its normal behaviour of tomcat and it happens but sometimes when i delete war file the directory remains.
 
Saloon Keeper
Posts: 27861
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you copy a war file into Tomcat's webapps directory to deploy it (and that is only one of several very different ways to deploy), then by default Tomcat will explode the WAR file into a directory of the same name. Thereafter the WAR file is completely ignored. Including that deleting the WAR file will not delete the exploded WAR directory. It also won't update the exploded WAR directory if you replace the old WAR file with a new WAR file.

However, if you delete the WAR directory and don't delete the WAR file, Tomcat will re-explode the WAR file and create a new exploded WAR directory, so you should delete the file first and then the directory.
 
Tim Holloway
Saloon Keeper
Posts: 27861
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Sachin Pachari wrote:Ok My Bad ! i may Have put it wrongly, but what i ment was, for a War deployment, the contents inside the WebContent folder are important



Not for me they aren't. I've never had a WebContent directory in my life even though I am using the JEE Eclipse spin that has WTP plugin pre-installed. I build using Maven and generally construct an OS installer package. I then install that package from the OS command line.
 
The airline is called "Virgin"? Don't you want a plane to go all the way? This tiny ad will go all the way:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic