I am looking to get personal files with ant, while using get property. I am running apache 2, and that i could possibly get the file in the indicated URL using wget and opera, but ant provides me with the next error:

[get] Error opening connection java.io.IOException:
 Server returned HTTP response code: 503 for URL: http://localhost/jars/jai_core.jar

This is exactly what I am doing during my build.xml:

<get src="http://localhost/jars/jai_core.jar"
     dest="${build.dir}/lib/jai_core.jar"
     usetimestamp="true"/>

Any idea what is failing?

EDIT: Onto something. After I supply the full host title of my box rather than localhost, it really works.

503 is Service Not available, which most likely implies that the src URL is not getting construed correctly and sent through the ANT task or possibly the JRE.

Here are a few items to try:

  • Of course, with ANT, execute the littlest possible build.xml with -verbose to ascertain if that provides anymore information, -debug for more details.

  • Try the verbose="true" attribute around the task.

  • use "http://127...1/jars/jai_core.jar" - based on what version from the java runtime ANT is performing under, 'localhost' might not be getting resolved properly.

  • Drop the usetimestamp attribute just to ascertain if it changes behavior.

  • Use another Java based application to try and carry out the GET and compare results.

Searching at th

The HTTP request may be dealing with a proxy that is rejecting the request. Alternatively ant is probably not utilizing a proxy where it will.

I appear to recall some problem with Java for this kind of factor. I do not recall the specifics however it popped on the netbeans subscriber list some time ago.