Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

java.io.IOException: Server returned HTTP response code: 500 for URL  RSS feed

 
koushi kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am calling a REST API, which will internally connect to 2000 servers(single host at a time) and collect the information and send back the response to my java program in a XML format.
to connect to each host and get the response is around 30 secs. I am using HTTPUrlConnection to get a XML response from this web service. I do not have control over the rest API, i can just consume it using the endpoint URL. when i run the program, i am getting java.io.IOException: Server returned HTTP response code: 500 for URL: http://<url>. Is this exception valid? as the actual API has to connect to multiple hosts and get response and by that time my server is responding with 500 status. if this is the case, is there any other better way to solve this issue? Please suggest.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
koushi kumar wrote:Is this exception valid?

What does this mean? What is a "valid" versus "invalid" exception?

A 500 response usually means that there was an unhandled exception on the server.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!