Reputation: 197
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?
Upvotes: 4
Views: 24169
Reputation: 83255
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.
Upvotes: 3