开发者

java.io.IOException: Server returned HTTP response code: 500 for URL: https://hostname:port/xxx.do

开发者 https://www.devze.com 2023-01-22 03:29 出处:网络
We are getting the \"java.io.IOException: Server returned HTTP response code: 500 for URL\" error for the following code which is for applet-servlet communication. The same code has been working for l

We are getting the "java.io.IOException: Server returned HTTP response code: 500 for URL" error for the following code which is for applet-servlet communication. The same code has been working for long and now suddenly we see this error. Could something be wrong with tomcat setup? Tomcat logs do not show any error. The exception is thrown on the java console which points to this piece of code. Is there a good way to debug this err开发者_StackOverflow中文版or code?

     URLConnection u = getConnection( url );
     BufferedOutputStream bo = new BufferedOutputStream( u.getOutputStream() );
     ObjectOutputStream oo = new ObjectOutputStream( bo );
     oo.writeObject( someobject );
     oo.flush();
     BufferedInputStream bi = new BufferedInputStream( u.getInputStream() ); //getting the error on this line
     ObjectInputStream oi = new ObjectInputStream( bi );
     Object a_object = oi.readObject();

Any help would be appreciated.


I would take the following steps:

  • Try the same URL from a browser, ideally on several different boxes and browsers
  • Use Wireshark to see what's happening on the network
  • Try to run the applet against a debugger, to see whether your code is actually getting called

Basically it's unlikely to be a client-side issue at all, unless something like a proxy is getting in the way and screwing things up. WireShark will show you what's happening on the network... and if it really is getting to your code, debugging should help you find out what's going on in your server, and hopefully why it's not getting into the Tomcat logs.


Do you have access to the Tomcat? You should inspect its log to find a reason of the error.


500 Internal Server Error is an Error on the Server, not the Client. If your program is the client, you can't fix this other that telling the server administrator to fix it.

0

精彩评论

暂无评论...
验证码 换一张
取 消