I had a similar problem; the bowser could access localhost:8080 but
ant tasks and some
java web service clients couldn't
I'm running Win7 and had installed wireshark earlier in the day but never rebooted.
I disabled IPv6 on my system and rebooted and it started working.
LATER: i re-enabled IPv6 and it was still working??? So i have to assume my problem was the rebooted. (Thanks nothing win7)