I’m trying to get a file with ant, using the get property. I’m running apache 2, and I can get the file from the indicated URL using wget and firefox, but ant gives me the following error:
[get] Error opening connection java.io.IOException: Server returned HTTP response code: 503 for URL: http://localhost/jars/jai_core.jar
This is what I’m doing in my build.xml:
<get src='http://localhost/jars/jai_core.jar' dest='${build.dir}/lib/jai_core.jar' usetimestamp='true'/>
Any idea what could be going wrong?
EDIT: On to something. When I provide the full host name of my box instead of localhost, it works.
503 is Service Unavailable, which probably means that the
srcURL isn’t getting interpreted properly and sent by the ANT task or perhaps the JRE.Here are some things to try:
As always, with ANT, execute the smallest possible build.xml with -verbose to see if that gives any more information, -debug for even more information.
Try the
verbose='true'attribute on the task.use ‘http://127.0.0.1/jars/jai_core.jar‘ – depending on what version of the java runtime ANT is executing under, ‘localhost’ may not be getting resolved correctly.
Drop the
usetimestampattribute just to see if it changes behavior.Use another Java based application to try to perform the GET and compare results.