简体   繁体   中英

java.io.IOException: Server returned HTTP response code: 502

i wrote a code which goes to a list of web addresses and get data from there. but when i run code some time code works mean goes to all web links and take data but some time i goes to 2 or 4 websites and get data and after them gives this exception followed by a web link form list.

java.io.IOException: Server returned HTTP response code: 502

but actually web link is alive not dead. when i run code for 2nd time then it runs but gives this exception for another link. code is too long thats why not posting it. if needed i can provide.

Whats this excetption about?

502 means "Bad Gateway". See http://www.checkupdown.com/status/E502.html .

The server the Java client is talking to is the "gateway". That server was depending on another server (called the "upstream" server) to give it a response and it failed.

In my experience, 502 errors are sporadic, and can indicate problems with server architecture.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM