Bug 50706 - ant-task undeploy uses GET while ManagerServlet requires POST in undeploy
ant-task undeploy uses GET while ManagerServlet requires POST in undeploy
Status: RESOLVED INVALID
Product: Tomcat 7
Classification: Unclassified
Component: Manager
7.0.6
PC Linux
: P2 minor (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2011-02-02 07:39 UTC by Markus Huelsekopf
Modified: 2011-02-02 09:02 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Huelsekopf 2011-02-02 07:39:01 UTC
ant-task "undeploy" fails:

Error message from "ant undeploy" (using working build.xml & deployer.properties input-files):

FAIL - Tried to use command /undeploy via a GET request but POST is required
(as templated in file  java/org/apache/catalina/manager/LocalStrings.properties line 94)


class UndeployTask uses AbstractCatalinaTask.execute(String)
(see line 79 of file java/org/apache/catalina/ant/UndeployTask.java)

class AbstractCatalinaTask.execute(String) uses http-method GET if InputStream is null (see line 196 of file java/org/apache/catalina/ant/AbstractCatalinaTask.java)



Just Info: 

"ant deploy" for an already deployed web-application undeploys and deploys the web-application without errors.

requesting undeploy via a webbrowser works without errors.
Comment 1 Mark Thomas 2011-02-02 08:04:02 UTC
You are using the wrong url.
Comment 2 Markus Huelsekopf 2011-02-02 08:40:46 UTC
I tried hard to find my error in the url, but haven't, sorry.

(In reply to comment #1)
> You are using the wrong url.
The error message is somewhat missleading than?

Hopefully URL is the same for "deploy" and "undeploy":

I am using "http://localhost:8080/manager/html":

-------------------------------------------------------------------
...
<property name="url" value="http://localhost:8080/manager/html"/>
...
<target name="deploy" description="Deploy web application">
    <deploy 
      url="${url}" 
      username="${username}" 
      password="${password}"
      path="${apppath}" 
      war="${appname}.war" 
      update="true" 
    />
  </target>

  <target name="undeploy" description="Undeploy web application">
    <undeploy 
      url="${url}" 
      username="${username}" 
      password="${password}" 
      path="${apppath}" 
   />
  </target>
-------------------------------------------------------------------
Comment 3 Konstantin Kolinko 2011-02-02 09:02:46 UTC
(In reply to comment #2)
> I am using "http://localhost:8080/manager/html":

Automatic tools, such as this one, should use URL of
http://localhost:8080/manager/text

and a user with the role of "manager-script".

It is recommended to never assign "manager-script" and "manager-gui" roles to the same user, but use separate users for these tasks.

The docs in 7.0 were updated recently. If anything else is needed, patches for webapps/docs are welcome.