We have next code. Sometimes we should wait 10-20-40 seconds on the last line. What can be the problem?
Java 1.4
URL url = ...; HttpURLConn
Had the same problem, found out it was caused by IPv6.
You Disable it from code using:
System.setProperty("java.net.preferIPv4Stack" , "true");
You can also disable it via the command line using : g-Djava.net.preferIPv4Stack=true
g-Djava.net.preferIPv4Stack=true