This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have a piece of standalone java code which works fine on mywindows machine.
But when I run the same code on my server (Linux Box) it gives back an error HTTP 500 error.
Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: http://abcd.xlsx at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at java.net.HttpURLConnection.getResponseMessage(Unknown Source)
... 1 more
Does anyone have any idea how do I proceed ahead ?
Error 500 is not related to login failures; those are 401 and 403. Error 500 is "Internal server error" which basically means the web page throws an error. Too bad the contents are no longer available in Java after the exception has been thrown; in VB I am able to retrieve the web page that displays the error.
amey mahadik wrote:But if that is the case then it should give me back the same response on my windows desktop machine.
I don't see why. There's any number of configuration options that could be different between the two machines. For example I see you're doing some kind of authentication in your code; perhaps that works differently from one machine to the next.
Joined: Mar 27, 2008
I have simply set the authenticator with the username and password so that it can be used by the networking code when the HTTP server or may be a proxy asks for authentication.
I am not sure if there are any configurations required for this.