Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Ant Undeploy Problem

Ranch Hand
Posts: 511
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello again,

I am using JDK 1.5, Eclipse 3.2 (bundled with Ant 1.6.5), and Tomcat 5.5.9 on WinXP.

I created the following Ant build script:

In my project directory, I have a sub-directory named "lib" which contains the particular jar files that I need for my web app. As you can see from looking at my build script, that this lib (after being unextracted from my war file) becomes placed underneath my WEB-INF directory after deployment (which its supposed to do).

Now, my problem is this:

1. When I run the undeploy Ant target from Eclipse's Ant View, I receive this error message:

At first, I thought that this was an Eclipse issue because when I tried to delete the NumberGuess directory under TOMCAT_HOME/webapps manually using Windows Explorer, it stated that another program or person was using this file/folder and that it was unable to do so. When I closed Eclipse and re-tried to manually delete the TOMCAT_HOME/webapps/numberguess folder from Windows Explorer, I was successful.

This led me to believe that it was just an Eclipse issue, but evidently, one can see the same thing happened when I didn't have Eclipse running and ran it from the command line (MS-DOS).

After some more investigation, I discovered that the problem was that I was running Tomcat when I tried to undeploy this application. When I shutdown Tomcat and tried to deploy/undeploy from Eclipse and the command line, it worked!

When I put this app onto a live tomcat server (which can not afford to be shutdown), my solution (which is manually shutdowning the Tomcat and then running my Ant undeploy target) will not be feasible.

Some questions:

(1) Is there a better way to structure an undeploy Ant target?

(2) Should I be using these built-in Ant deploy and undeploy tasks, instead:

- org.apache.catalina.ant.DeployTask

- org.apache.catalina.ant.UndeployTask

Many, many thanks!
[ December 06, 2006: Message edited by: Unnsse Khan ]
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic