ant undeploy task error
Posted
by Devil Jin
on Stack Overflow
See other posts from Stack Overflow
or by Devil Jin
Published on 2010-05-14T02:35:35Z
Indexed on
2010/05/14
2:44 UTC
Read the original article
Hit count: 435
I am using ant 1.7 to deploy and undeploy applications in tomcat
//Snippet from my build.xml
<target name="deploy" depends="war" description="Install application to the servlet containor">
<deploy url="${tomcat.manager.url}"
username="${manager.user}"
password="${manager.passwd}"
path="/${tomcat.ctxpath}"
war="${war.local}" />
</target>
<target name="undeploy" description="Removes Web Application from path">
<undeploy url="${tomcat.manager.url}"
username="${manager.user}"
password="${manager.passwd}"
path="/${tomcat.ctxpath}" />
</target>
The deploy task works perfectly fine but the undeploy task gives an html output for the undeploy task prefixed with [undeploy] although the application is undeployed successfully The html message also contains the success message 'OK - Undeployed application at context path /MyApplication'
OUTPUT:
[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:Tah
oma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:whit
e;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background
:white;color:black;font-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] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-style:italic;
[undeploy] font-weight: bold;
[undeploy] background: #D2A41C;
[undeploy] }
[undeploy] td.header-left {
[undeploy] text-align: left;
[undeploy] vertical-align: top;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-weight: bold;
[undeploy] background: #FFDC75;
[undeploy] }
[undeploy] td.header-center {
[undeploy] text-align: center;
[undeploy] vertical-align: top;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-weight: bold;
[undeploy] background: #FFDC75;
[undeploy] }
[undeploy] td.row-left {
[undeploy] text-align: left;
[undeploy] vertical-align: middle;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] color: black;
[undeploy] }
[undeploy] td.row-center {
[undeploy] text-align: center;
[undeploy] vertical-align: middle;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] color: black;
[undeploy] }
[undeploy] td.row-right {
[undeploy] text-align: right;
[undeploy] vertical-align: middle;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] color: black;
[undeploy] }
[undeploy] TH {
[undeploy] text-align: center;
[undeploy] vertical-align: top;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] font-weight: bold;
[undeploy] background: #FFDC75;
[undeploy] }
[undeploy] TD {
[undeploy] text-align: center;
[undeploy] vertical-align: middle;
[undeploy] font-family:sans-serif,Tahoma,Arial;
[undeploy] color: black;
[undeploy] }
[undeploy] </style>
[undeploy] <title>/manager</title>
[undeploy] </head>
[undeploy] <body bgcolor="#FFFFFF">
[undeploy] <table cellspacing="4" width="100%" border="0">
[undeploy] <tr>
[undeploy] <td colspan="2">
[undeploy] <a href="http://www.apache.org/">
[undeploy] <img border="0" alt="The Apache Software Foundation" align="left"
[undeploy] src="/manager/images/asf-logo.gif">
[undeploy] </a>
[undeploy] <a href="http://tomcat.apache.org/">
[undeploy] <img border="0" alt="The Tomcat Servlet/JSP Container"
[undeploy] align="right" src="/manager/images/tomcat.gif">
[undeploy] </a>
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <hr size="1" noshade="noshade">
[undeploy] <table cellspacing="4" width="100%" border="0">
[undeploy] <tr>
[undeploy] <td class="page-title" bordercolor="#000000" align="left" nowrap>
[undeploy] <font size="+2">Tomcat Web Application Manager</font>
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br>
[undeploy] <table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td class="row-left" width="10%"><small><strong>Message:</strong></small> </td>
[undeploy] <td class="row-left"><pre>OK - Undeployed application at context path /MyApplication
[undeploy] </pre></td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br>
[undeploy] <table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td colspan="4" class="title">Manager</td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left"><a href="/manager/html/list">List Applications</a></td>
[undeploy] <td class="row-center"><a href="/manager/../docs/html-manager-howto.html">HTML Manager Help</a></td>
[undeploy] <td class="row-center"><a href="/manager/../docs/manager-howto.html">Manager Help</a></td>
[undeploy] <td class="row-right"><a href="/manager/status">Server Status</a></td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br>
[undeploy] <table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td colspan="5" class="title">Applications</td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="header-left"><small>Path</small></td>
[undeploy] <td class="header-left"><small>Display Name</small></td>
[undeploy] <td class="header-center"><small>Running</small></td>
[undeploy] <td class="header-center"><small>Sessions</small></td>
[undeploy] <td class="header-left"><small>Commands</small></td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/">/</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Welcome to Tomcat</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions?path=/" target="_bla
nk">0</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <small>
[undeploy] Start
[undeploy] <a href="/manager/html/stop?path=/" onclick="return(confirm('Are you sure?'))">Stop</a>
[undeploy] <a href="/manager/html/reload?path=/" onclick="return(confirm('Are you sure?'))">Reload</a>
[undeploy] <a href="/manager/html/undeploy?path=/" onclick="return(confirm('Are you sure?'))">Undeploy</a>
[undeploy] </small>
[undeploy] </td>
[undeploy] </tr><tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <form method="POST" action="/manager/html/expire?path=/">
[undeploy] <small>
[undeploy] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" siz
e="5" value="30"> minutes
[undeploy] </small>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><a href="/docs">/docs</a></small></td>
[undeploy] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small>Tomcat Documentation</small></td>
[undeploy] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small>true</small></td>
[undeploy] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small><a href="/manager/html/sessions?path=/docs" target="
_blank">0</a></small></td>
[undeploy] <td class="row-left" bgcolor="#C3F3C3">
[undeploy] <small>
[undeploy] Start
[undeploy] <a href="/manager/html/stop?path=/docs" onclick="return(confirm('Are you sure?'))">Stop</a>
[undeploy] <a href="/manager/html/reload?path=/docs" onclick="return(confirm('Are you sure?'))">Reload</a>
[undeploy] <a href="/manager/html/undeploy?path=/docs" onclick="return(confirm('Are you sure?'))">Undeploy</a>
[undeploy] </small>
[undeploy] </td>
[undeploy] </tr><tr>
[undeploy] <td class="row-left" bgcolor="#C3F3C3">
[undeploy] <form method="POST" action="/manager/html/expire?path=/docs">
[undeploy] <small>
[undeploy] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" siz
e="5" value="30"> minutes
[undeploy] </small>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/examples">/examples</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Servlet and JSP Examples</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions?path=/examples" targ
et="_blank">0</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <small>
[undeploy] Start
[undeploy] <a href="/manager/html/stop?path=/examples" onclick="return(confirm('Are you sure?'))">Stop</a>
[undeploy] <a href="/manager/html/reload?path=/examples" onclick="return(confirm('Are you sure?'))">Reload</a>
[undeploy] <a href="/manager/html/undeploy?path=/examples" onclick="return(confirm('Are you sure?'))">Undeploy</a>&n
bsp;
[undeploy] </small>
[undeploy] </td>
[undeploy] </tr><tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <form method="POST" action="/manager/html/expire?path=/examples">
[undeploy] <small>
[undeploy] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" siz
e="5" value="30"> minutes
[undeploy] </small>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><a href="/host%2Dmanager">/host-manager</a></small></t
d>
[undeploy] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small>Tomcat Manager Application</small></td>
[undeploy] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small>true</small></td>
[undeploy] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small><a href="/manager/html/sessions?path=/host%2Dmanager
" target="_blank">0</a></small></td>
[undeploy] <td class="row-left" bgcolor="#C3F3C3">
[undeploy] <small>
[undeploy] Start
[undeploy] <a href="/manager/html/stop?path=/host%2Dmanager" onclick="return(confirm('Are you sure?'))">Stop</a>&nbs
p;
[undeploy] <a href="/manager/html/reload?path=/host%2Dmanager" onclick="return(confirm('Are you sure?'))">Reload</a>
[undeploy] <a href="/manager/html/undeploy?path=/host%2Dmanager" onclick="return(confirm('Are you sure?'))">Undeploy
</a>
[undeploy] </small>
[undeploy] </td>
[undeploy] </tr><tr>
[undeploy] <td class="row-left" bgcolor="#C3F3C3">
[undeploy] <form method="POST" action="/manager/html/expire?path=/host%2Dmanager">
[undeploy] <small>
[undeploy] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" siz
e="5" value="30"> minutes
[undeploy] </small>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager">/manager</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Tomcat Manager Application</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[undeploy] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions?path=/manager" targe
t="_blank">3</a></small></td>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <small>
[undeploy] Start
[undeploy] Stop
[undeploy] Reload
[undeploy] Undeploy
[undeploy] </small>
[undeploy] </td>
[undeploy] </tr><tr>
[undeploy] <td class="row-left" bgcolor="#FFFFFF">
[undeploy] <form method="POST" action="/manager/html/expire?path=/manager">
[undeploy] <small>
[undeploy] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" siz
e="5" value="30"> minutes
[undeploy] </small>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br>
[undeploy] <table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td colspan="2" class="title">Deploy</td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2" class="header-left"><small>Deploy directory or WAR file located on server</small></td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2">
[undeploy] <form method="get" action="/manager/html/deploy">
[undeploy] <table cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy] <small>Context Path (required):</small>
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="text" name="deployPath" size="20">
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy] <small>XML Configuration file URL:</small>
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="text" name="deployConfig" size="20">
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy] <small>WAR or Directory URL:</small>
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="text" name="deployWar" size="40">
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy]
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="submit" value="Deploy">
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2" class="header-left"><small>WAR file to deploy</small></td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2">
[undeploy] <form action="/manager/html/upload" method="post" enctype="multipart/form-data">
[undeploy] <table cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy] <small>Select WAR file to upload</small>
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="file" name="deployWar" size="40">
[undeploy] </td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-right">
[undeploy]
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <input type="submit" value="Deploy">
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] </form>
[undeploy] </table>
[undeploy] <br>
[undeploy] <table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td colspan="2" class="title">Diagnostics</td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2" class="header-left"><small>Check to see if a web application has caused a memory leak on stop, r
eload or undeploy</small></td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td colspan="2">
[undeploy] <form method="post" action="/manager/html/findleaks">
[undeploy] <table cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td class="row-left">
[undeploy] <input type="submit" value="Find leaks">
[undeploy] </td>
[undeploy] <td class="row-left">
[undeploy] <small>This diagnostic check will trigger a full garbage collection. Use it with extreme caution on production
systems.</small>
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] </form>
[undeploy] </td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br><table border="1" cellspacing="0" cellpadding="3">
[undeploy] <tr>
[undeploy] <td colspan="6" class="title">Server Information</td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="header-center"><small>Tomcat Version</small></td>
[undeploy] <td class="header-center"><small>JVM Version</small></td>
[undeploy] <td class="header-center"><small>JVM Vendor</small></td>
[undeploy] <td class="header-center"><small>OS Name</small></td>
[undeploy] <td class="header-center"><small>OS Version</small></td>
[undeploy] <td class="header-center"><small>OS Architecture</small></td>
[undeploy] </tr>
[undeploy] <tr>
[undeploy] <td class="row-center"><small>Apache Tomcat/6.0.26</small></td>
[undeploy] <td class="row-center"><small>1.5.0_09-b01</small></td>
[undeploy] <td class="row-center"><small>Sun Microsystems Inc.</small></td>
[undeploy] <td class="row-center"><small>Windows XP</small></td>
[undeploy] <td class="row-center"><small>5.1</small></td>
[undeploy] <td class="row-center"><small>x86</small></td>
[undeploy] </tr>
[undeploy] </table>
[undeploy] <br>
[undeploy] <hr size="1" noshade="noshade">
[undeploy] <center><font size="-1" color="#525D76">
[undeploy] <em>Copyright © 1999-2010, Apache Software Foundation</em></font></center>
[undeploy] </body>
[undeploy] </html>
© Stack Overflow or respective owner