使用 Tomcat 7 的 tomcat-maven-plugin - tomcat:deploy 有效,tomcat:undeploy 无效
Posted
技术标签:
【中文标题】使用 Tomcat 7 的 tomcat-maven-plugin - tomcat:deploy 有效,tomcat:undeploy 无效【英文标题】:tomcat-maven-plugin using Tomcat 7 - tomcat:deploy works, tomcat:undeploy doesn't 【发布时间】:2012-07-25 23:07:43 【问题描述】:我有一个 tomcat:deploy 的工作配置,但是当我取消部署 WAR 时,我收到以下错误,这让我很困惑:
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com:DocBookScratchProject:war:0.1.0.BUILD-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. @ line 166, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building DocBookScratchProject 0.1.0.BUILD-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- tomcat-maven-plugin:1.1:undeploy (default-cli) @ DocBookScratchProject ---
[INFO] Undeploying application at http://localhost:8080/DocBookScratchProject
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.769s
[INFO] Finished at: Fri Jul 27 10:17:24 BST 2012
[INFO] Final Memory: 11M/110M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:undeploy (default-cli) on project DocBookScratchProject: Cannot invoke Tomcat manager: <html>
[ERROR] <head>
[ERROR] <style>
[ERROR] H1 font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px; H2 font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px; H3 font-family:Tahoma,Arial,sans-serif;color:white;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;
[ERROR] table
[ERROR] width: 100%;
[ERROR]
[ERROR] td.page-title
[ERROR] text-align: center;
[ERROR] vertical-align: top;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] font-weight: bold;
[ERROR] background: white;
[ERROR] color: black;
[ERROR]
[ERROR] td.title
[ERROR] text-align: left;
[ERROR] vertical-align: top;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] font-style:italic;
[ERROR] font-weight: bold;
[ERROR] background: #D2A41C;
[ERROR]
[ERROR] td.header-left
[ERROR] text-align: left;
[ERROR] vertical-align: top;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] font-weight: bold;
[ERROR] background: #FFDC75;
[ERROR]
[ERROR] td.header-center
[ERROR] text-align: center;
[ERROR] vertical-align: top;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] font-weight: bold;
[ERROR] background: #FFDC75;
[ERROR]
[ERROR] td.row-left
[ERROR] text-align: left;
[ERROR] vertical-align: middle;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] color: black;
[ERROR]
[ERROR] td.row-center
[ERROR] text-align: center;
[ERROR] vertical-align: middle;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] color: black;
[ERROR]
[ERROR] td.row-right
[ERROR] text-align: right;
[ERROR] vertical-align: middle;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] color: black;
[ERROR]
[ERROR] TH
[ERROR] text-align: center;
[ERROR] vertical-align: top;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] font-weight: bold;
[ERROR] background: #FFDC75;
[ERROR]
[ERROR] TD
[ERROR] text-align: center;
[ERROR] vertical-align: middle;
[ERROR] font-family:sans-serif,Tahoma,Arial;
[ERROR] color: black;
[ERROR]
[ERROR] form
[ERROR] margin: 1;
[ERROR]
[ERROR] form.inline
[ERROR] display: inline;
[ERROR]
[ERROR] </style>
[ERROR] <title>/manager</title>
[ERROR] </head>
[ERROR]
[ERROR] <body bgcolor="#FFFFFF">
[ERROR]
[ERROR] <table cellspacing="4" border="0">
[ERROR] <tr>
[ERROR] <td colspan="2">
[ERROR] <a href="http://www.apache.org/">
[ERROR] <img border="0" align="left"
[ERROR] src="/manager/images/asf-logo.gif">
[ERROR] </a>
[ERROR] <a href="http://tomcat.apache.org/">
[ERROR] <img border="0"
[ERROR] align="right" src="/manager/images/tomcat.gif">
[ERROR] </a>
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <hr size="1" noshade="noshade">
[ERROR] <table cellspacing="4" border="0">
[ERROR] <tr>
[ERROR] <td class="page-title" bordercolor="#000000" align="left" nowrap>
[ERROR] <font size="+2">Tomcat Web Application Manager</font>
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br>
[ERROR]
[ERROR] <table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td class="row-left" ><small><strong>Message:</strong></small> </td>
[ERROR] <td class="row-left"><pre>FAIL - Tried to use command /undeploy via a GET request but POST is required</pre></td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br>
[ERROR]
[ERROR] <table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td colspan="4" class="title">Manager</td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left"><a href="/manager/html/list;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">List Applications</a></td>
[ERROR] <td class="row-center"><a href="/manager/../docs/html-manager-howto.html?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">HTML Manager Help</a></td>
[ERROR] <td class="row-center"><a href="/manager/../docs/manager-howto.html?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">Manager Help</a></td>
[ERROR] <td class="row-right"><a href="/manager/status;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">Server Status</a></td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br>
[ERROR]
[ERROR] <table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td colspan="6" class="title">Applications</td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="header-left"><small>Path</small></td>
[ERROR] <td class="header-left"><small>Version</small></td>
[ERROR] <td class="header-center"><small>Display Name</small></td>
[ERROR] <td class="header-center"><small>Running</small></td>
[ERROR] <td class="header-left"><small>Sessions</small></td>
[ERROR] <td class="header-left"><small>Commands</small></td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/">/</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><i>None specified</i></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Welcome to Tomcat</small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">0</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <small>Start</small>
[ERROR] <form class="inline" method="POST" action="/manager/html/stop;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Stop"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/reload;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Reload"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/undeploy;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Undeploy"></small> </form>
[ERROR] </td>
[ERROR] </tr><tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <form method="POST" action="/manager/html/expire;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <small>
[ERROR] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" size="5" value="30"> minutes
[ERROR] </small>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><a href="/DocBookScratchProject">/DocBookScratchProject</a></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><i>None specified</i></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small> </small></td>
[ERROR] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small>true</small></td>
[ERROR] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small><a href="/manager/html/sessions;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/DocBookScratchProject&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">0</a></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3">
[ERROR] <small>Start</small>
[ERROR] <form class="inline" method="POST" action="/manager/html/stop;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/DocBookScratchProject&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Stop"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/reload;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/DocBookScratchProject&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Reload"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/undeploy;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/DocBookScratchProject&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Undeploy"></small> </form>
[ERROR] </td>
[ERROR] </tr><tr>
[ERROR] <td class="row-left" bgcolor="#C3F3C3">
[ERROR] <form method="POST" action="/manager/html/expire;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/DocBookScratchProject&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <small>
[ERROR] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" size="5" value="30"> minutes
[ERROR] </small>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/help">/help</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><i>None specified</i></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small> </small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/help&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">0</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <small>Start</small>
[ERROR] <form class="inline" method="POST" action="/manager/html/stop;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/help&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Stop"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/reload;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/help&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Reload"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/undeploy;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/help&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Undeploy"></small> </form>
[ERROR] </td>
[ERROR] </tr><tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <form method="POST" action="/manager/html/expire;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/help&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <small>
[ERROR] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" size="5" value="30"> minutes
[ERROR] </small>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><a href="/host%2Dmanager">/host-manager</a></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small><i>None specified</i></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3" rowspan="2"><small>Tomcat Host Manager Application</small></td>
[ERROR] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small>true</small></td>
[ERROR] <td class="row-center" bgcolor="#C3F3C3" rowspan="2"><small><a href="/manager/html/sessions;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/host%2Dmanager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">0</a></small></td>
[ERROR] <td class="row-left" bgcolor="#C3F3C3">
[ERROR] <small>Start</small>
[ERROR] <form class="inline" method="POST" action="/manager/html/stop;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/host%2Dmanager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Stop"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/reload;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/host%2Dmanager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Reload"></small> </form>
[ERROR] <form class="inline" method="POST" action="/manager/html/undeploy;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/host%2Dmanager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98"> <small><input type="submit" value="Undeploy"></small> </form>
[ERROR] </td>
[ERROR] </tr><tr>
[ERROR] <td class="row-left" bgcolor="#C3F3C3">
[ERROR] <form method="POST" action="/manager/html/expire;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/host%2Dmanager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <small>
[ERROR] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" size="5" value="30"> minutes
[ERROR] </small>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager">/manager</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small><i>None specified</i></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF" rowspan="2"><small>Tomcat Manager Application</small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small>true</small></td>
[ERROR] <td class="row-center" bgcolor="#FFFFFF" rowspan="2"><small><a href="/manager/html/sessions;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/manager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">9</a></small></td>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <small>
[ERROR] Start
[ERROR] Stop
[ERROR] Reload
[ERROR] Undeploy
[ERROR] </small>
[ERROR] </td>
[ERROR] </tr><tr>
[ERROR] <td class="row-left" bgcolor="#FFFFFF">
[ERROR] <form method="POST" action="/manager/html/expire;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?path=/manager&org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <small>
[ERROR] <input type="submit" value="Expire sessions"> with idle ≥ <input type="text" name="idle" size="5" value="30"> minutes
[ERROR] </small>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br>
[ERROR] <table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td colspan="2" class="title">Deploy</td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2" class="header-left"><small>Deploy directory or WAR file located on server</small></td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2">
[ERROR] <form method="post" action="/manager/html/deploy;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <table cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR] <small>Context Path (required):</small>
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="text" name="deployPath" size="20">
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR] <small>XML Configuration file URL:</small>
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="text" name="deployConfig" size="20">
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR] <small>WAR or Directory URL:</small>
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="text" name="deployWar" size="40">
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR]
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="submit" value="Deploy">
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2" class="header-left"><small>WAR file to deploy</small></td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2">
[ERROR] <form method="post" action="/manager/html/upload;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98" enctype="multipart/form-data">
[ERROR] <table cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR] <small>Select WAR file to upload</small>
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="file" name="deployWar" size="40">
[ERROR] </td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-right">
[ERROR]
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <input type="submit" value="Deploy">
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] </form>
[ERROR] </table>
[ERROR] <br>
[ERROR]
[ERROR] <table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td colspan="2" class="title">Diagnostics</td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2" class="header-left"><small>Check to see if a web application has caused a memory leak on stop, reload or undeploy</small></td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td colspan="2">
[ERROR] <form method="post" action="/manager/html/findleaks;jsessionid=724F30BC8ED2E6CE4F8A1EC4CB1E5B50?org.apache.catalina.filters.CSRF_NONCE=D9447A84FBF3B6DCC2C067BAA2539F98">
[ERROR] <table cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td class="row-left">
[ERROR] <input type="submit" value="Find leaks">
[ERROR] </td>
[ERROR] <td class="row-left">
[ERROR] <small>This diagnostic check will trigger a full garbage collection. Use it with extreme caution on production systems.</small>
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] </form>
[ERROR] </td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br><table border="1" cellspacing="0" cellpadding="3">
[ERROR] <tr>
[ERROR] <td colspan="8" class="title">Server Information</td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="header-center"><small>Tomcat Version</small></td>
[ERROR] <td class="header-center"><small>JVM Version</small></td>
[ERROR] <td class="header-center"><small>JVM Vendor</small></td>
[ERROR] <td class="header-center"><small>OS Name</small></td>
[ERROR] <td class="header-center"><small>OS Version</small></td>
[ERROR] <td class="header-center"><small>OS Architecture</small></td>
[ERROR] <td class="header-center"><small>Hostname</small></td>
[ERROR] <td class="header-center"><small>IP Address</small></td>
[ERROR] </tr>
[ERROR] <tr>
[ERROR] <td class="row-center"><small>Apache Tomcat/7.0.28</small></td>
[ERROR] <td class="row-center"><small>1.6.0_29-b11</small></td>
[ERROR] <td class="row-center"><small>Sun Microsystems Inc.</small></td>
[ERROR] <td class="row-center"><small>Windows 7</small></td>
[ERROR] <td class="row-center"><small>6.1</small></td>
[ERROR] <td class="row-center"><small>amd64</small></td>
[ERROR] <td class="row-center"><small>Mat-PC</small></td>
[ERROR] <td class="row-center"><small>10.201.113.100</small></td>
[ERROR] </tr>
[ERROR] </table>
[ERROR] <br>
[ERROR]
[ERROR] <hr size="1" noshade="noshade">
[ERROR] <center><font size="-1" color="#525D76">
[ERROR] <em>Copyright © 1999-2012, Apache Software Foundation</em></font></center>
[ERROR]
[ERROR] </body>
[ERROR] </html>
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Tomcat-users.xml:
<?xml version='1.0' encoding='utf-8'?>
<tomcat-users>
<role rolename="tomcat"/>
<role rolename="manager"/>
<role rolename="manager-script"/>
<role rolename="manager-gui"/>
<role rolename="standard"/>
<role rolename="admin"/>
<user username="admin" password="password" roles="tomcat,manager,manager-script,manager-gui,standard,admin"/>
</tomcat-users>
Maven settings.xml sn-p:
<servers>
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>password</password>
</server>
</servers>
POM sn-p:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>tomcat-maven-plugin</artifactId>
<configuration>
<url>http://localhost:8080/manager/html</url>
<server>TomcatServer</server>
<path>/$project.build.finalName</path>
</configuration>
</plugin>
【问题讨论】:
您好,我也有同样的问题,新的 tomcat 插件没有取消部署(只是更新,但我需要真正的取消部署)...您解决了这个问题吗? 恐怕不行 - 我还在寻找。我每次都使用 mvn:package 并手动将 WAR 部署到独立的 Tomcat7 实例:-( 【参考方案1】:我最终使用 tomcat7:deploy 进行部署(或重新部署 update=true)
<plugin>
<groupId>org.apache.tomcat.maven</groupId>
<artifactId>tomcat7-maven-plugin</artifactId>
<version>2.0-SNAPSHOT</version>
<configuration>
<url>http://localhost:8080/manager/html</url>
<username>admin</username>
<password>pass</password>
<path>/App</path>
<update>true</update>
</configuration>
</plugin>
并取消部署
curl -d "path=/App" "http://admin:pass@localhost:8080/manager/html/undeploy"
jenkins 我需要这个
【讨论】:
【参考方案2】:日志表明您的 pom.xml 中存在未定义版本的问题:
[WARNING] Some problems were encountered while building the effective model for com:DocBookScratchProject:war:0.1.0.BUILD-SNAPSHOT
[WARNING] 'build.plugins.plugin.version' for org.codehaus.mojo:tomcat-maven-plugin is missing. @ line 166, column 12
我会先解决这个问题。
如果取消部署失败,通常与未关闭的资源(如连接池)有关。通常您可以尝试取消部署,让它失败并查看哪些文件仍然存在。这通常有助于确定问题的根源。
有一些与部署/取消部署相关的tomcat选项:
antiJARLocking 反资源锁定见:http://tomcat.apache.org/tomcat-7.0-doc/config/context.html
希望在这里有所帮助。
【讨论】:
hm 我认为他的问题是“失败 - 尝试通过 GET 请求使用命令 /undeploy 但需要 POST”,这是因为为 tomcat 6 编写的旧插件。而新的一个 han' t 取消部署命令【参考方案3】:这里只是一个旁注:您必须使用 tomcat7:deploy 目标 NOT tomcat:deploy 目标才能使其工作。
【讨论】:
以上是关于使用 Tomcat 7 的 tomcat-maven-plugin - tomcat:deploy 有效,tomcat:undeploy 无效的主要内容,如果未能解决你的问题,请参考以下文章
使用 CLI/Boto 创建 Java 7、Tomcat 7 Elastic Beanstalk 实例
放弃连接的警告 - 使用 tomcat 7 抛出 PooledConnection 异常