my dog learned polymorphism*
The moose likes Tomcat and the fly likes UnDeploy task is not working properly Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "UnDeploy task is not working properly" Watch "UnDeploy task is not working properly" New topic
Author

UnDeploy task is not working properly

Srinivas Ivaturi
Ranch Hand

Joined: Jan 28, 2003
Posts: 50
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/tomcatTasks.properties">
<classpath>
<pathelement path="C:\Program Files\Apache Software Foundation\Tomcat 5.0\server\lib\catalina-ant.jar"/>
</classpath>
</taskdef>


<target name="install" description="Install application in Tomcat" >
<deploy url="http://localhost:8080/manager/html"
username="admin"
password="admin"
path="/AdderWAR"
war="file:E://AntExample//AdderDeploy//dist//AdderWAR.war"/>
</target>

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

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

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

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

check-cond:

uninstall:
[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;}A.name {color : black;}HR {color : #525D76;} table {
[undeploy] width: 100%;
[undeploy] }
[undeploy] td.page-title {
[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>

BUILD FAILED



Thanks in advance
Srinivas Ivaturi.
Ray Stojonic
Ranch Hand

Joined: Aug 08, 2003
Posts: 326
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: UnDeploy task is not working properly
 
Similar Threads
using apache soap webservice in jboss
Apache axis
Problem while Deploy web service
Regarding struts with ajax
unable to configure custom error pages