Buildfile: D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/build.xml
prepare:
compile:
dep:
deploy.webapp:
[get] Getting: http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war
[get] To: D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/a.html
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 505 for URL: http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war
[get] Can't get http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war to D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/a.html
BUILD FAILED
D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/build.xml:127: Can't get http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/ant.war to D:/Program Files/MyEclipse 5.1.1 GA/workspace/ant/a.html
Total time: 984 milliseconds
=========================
解决方案:(1)检查所在路径是否有空格例如:D:/Program Files/MyEclipse 5.1.1 GA/workspace/其中有空格Build时不稳定是要出问题的;
(2)系统防火墙是否将8080端口给屏蔽掉;
(3)JDK的版本是否>=1.4
=====================
可正常运行的例子:
<project default="deploy.webapp" basedir=".">
<target name="deploy.webapp" depends="undeploy.webapp">
<get dest="deployresult.html" src="http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=redeploy&argType=java.net.URL&arg0=file:${basedir}/ant.war" />
</target>
<target name="undeploy.webapp">
<get dest="deployresult.html" src="http://localhost:8080/jmx-console/HtmlAdaptor?action=invokeOpByName&name=jboss.system:service%3DMainDeployer&methodName=undeploy&argType=java.net.URL&arg0=file:${basedir}/ant.war" />
</target>
</project>
祝您成功!===================还有不明白的给我发mail吧shandongcn#sina.com