java.io.IOException: Server returned HTTP response code: 502 for URL: http://foo.bar.baz/

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via JDK Bug System by Vikrant Agarwal, 1 year ago
Server returned HTTP response code: 502 for URL: http://foo.bar.baz/
via GitHub by elstringer
, 2 years ago
Server returned HTTP response code: 403 for URL: http://starmade-servers.com/api/?object=servers&element=voters&key=API_KEY&month=current&format=json
via Oracle Community by 843834, 6 months ago
Server returned HTTP response code :401 for URL: //localhost/localstart.asp
via Google Groups by Luca Milanesio, 3 days ago
Server returned HTTP response code: 401 for URL: http://admin:secret@localhost:8080/a/projects/
via Oracle Community by 807551, 1 year ago
Server returned HTTP response code: 401 for URL: http://129.0.0.008/diiop_ior.txt
via Oracle Community by 843834, 1 year ago
Server returned HTTP response code: 407 for URL: http://www.google.com/
java.io.IOException: Server returned HTTP response code: 502 for URL: http://foo.bar.baz/
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1628)
at java.net.URL.openStream(URL.java:1048)
at undefined.OpenStream.main(OpenStream.java:41)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

Once, 1 year ago
2 times, 1 year ago
Once, 1 year ago
Samebug visitor profile picture
Unknown user
Once, 10 months ago
Samebug visitor profile picture
Unknown user
Once, 1 year ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.