Bug 62809 - cannot remote deploy with Ant DeployTask
Summary: cannot remote deploy with Ant DeployTask
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 9
Classification: Unclassified
Component: Manager (show other bugs)
Version: 9.0.12
Hardware: PC All
: P2 normal (vote)
Target Milestone: -----
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-10-09 07:33 UTC by Satoshi Kubo
Modified: 2018-10-16 10:25 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Satoshi Kubo 2018-10-09 07:33:49 UTC
I try to remote deploy with Ant DeployTask, but it not works.


source
----
DeployTask deployer = new DeployTask();
deployer.setUpdate(true);
deployer.setWar("C:\\tmp\\WebApplication1.war"); // if change to setLocalWar, it works.
deployer.setUsername("tomcat");
deployer.setPassword("tomcat");
deployer.setUrl("http://localhost:8080/manager/text");
deployer.setPath("/WebApplication1");

deployer.execute();





stacktrace
----
Exception in thread "main" java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
	at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:270)
	at org.apache.catalina.ant.DeployTask.execute(DeployTask.java:178)
	at tomcattest.TomcatTest.main(TomcatTest.java:28)
Caused by: java.net.HttpRetryException: cannot retry due to server authentication, in streaming mode
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1692)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)
	at org.apache.catalina.ant.AbstractCatalinaTask.execute(AbstractCatalinaTask.java:231)
	... 2 more
Comment 1 Mark Thomas 2018-10-15 18:54:54 UTC
This appears to be a consequence of the way DIGEST support was implemented for bug 45832. I'm currently looking at options for fixing this.
Comment 2 Mark Thomas 2018-10-15 19:34:20 UTC
As a work-around, use the following code before the DeployTask. It causes the credentials to be cached so the DeployTask is performed with the credentials present which avoids this issue.
Comment 3 Mark Thomas 2018-10-15 19:50:19 UTC
Sorry, missed the code:

ListTask list = new ListTask();
list.setUsername("tomcat");
list.setPassword("tomcat");
list.setUrl("http://localhost:8080/manager/text");
list.execute();
Comment 4 Satoshi Kubo 2018-10-16 08:06:52 UTC
Thanks.
Your information helped me a lot.
Comment 5 Mark Thomas 2018-10-16 10:25:14 UTC
Fixed in:
- trunk for 9.0.13 onwards
- 8.5.x for 8.5.35 onwards
- 7.0.x for 7.0.92 onwards