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
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.
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.
Sorry, missed the code: ListTask list = new ListTask(); list.setUsername("tomcat"); list.setPassword("tomcat"); list.setUrl("http://localhost:8080/manager/text"); list.execute();
Thanks. Your information helped me a lot.
Fixed in: - trunk for 9.0.13 onwards - 8.5.x for 8.5.35 onwards - 7.0.x for 7.0.92 onwards