This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

UnDeploy task is not working properly  RSS feed

Srinivas Ivaturi
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a build.xml which will undeploy my existing web context and re-deploy it again. The build.xml is as below. But my requirement is I will send the condition from command line.

<!-- Tomcat Ant Tasks -->
<!--<project name="webmodulebuilder" default="remove" basedir=".">-->
<project name="webmodulebuilder" default="all" basedir=".">
<taskdef file="D:/AntExample/TomcatAnt/">
<pathelement path="C:\Program Files\Apache Software Foundation\Tomcat 5.0\server\lib\catalina-ant.jar"/>

<target name="install" description="Install application in Tomcat" >
<deploy url="http://localhost:8080/manager/html"

<target name="check-cond">
<condition property="cond-is-true">
<equals arg1="Yes" arg2="${x}" />

<target name="uninstall" description="Remove application from Tomcat" depends="check-cond" if="cond-is-true">
<undeploy url="http://localhost:8080/manager/html"

<target name="all" depends="uninstall, install" />

After execution of uninstall target it is saying BUILD FAILED. And not installing the new web module again. Can somebody look into the script and tell me if I am doing any mistake.

It is generating HTML dump like below . There is more HTML dump so I am pasting some part.

D:\AntExample\TomcatAnt>ant -Dx=Yes
Buildfile: build.xml


[undeploy] <html>
[undeploy] <head>
[undeploy] <style>
[undeploy] H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,A
rial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;backgrou
nd-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Ta
homa,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;f
ont-size:12px;}A {color : black;} {color : black;}HR {color : #525D76;} table {
[undeploy] width: 100%;
[undeploy] }
[undeploy] {
[undeploy] text-align: center;
[undeploy] vertical-align: top;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-weight: bold;
[undeploy] background: white;
[undeploy] color: black;
[undeploy] }
[undeploy] td.title {
[undeploy] text-align: left;
[undeploy] vertical-align: top;
[undeploy] <hr size="1" noshade="noshade">
[undeploy] <center><font size="-1" color="#525D76">
[undeploy] <em>Copyright © 1999-2003, Apache Software Foundation</em></font></center>

[undeploy] </body>
[undeploy] </html>


Thanks in advance
Srinivas Ivaturi.
Ray Stojonic
Ranch Hand
Posts: 326
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
undeploy is looking for the manager url, not the manager/html url.
deploy is going to fail when you get that far because file: should refer to an expanded web-app, use jar: to refer to a war.

How to use Tomcat Ant tasks
[ June 10, 2005: Message edited by: Ray Stojonic ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!