Reputation: 8850
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 error 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.
Upvotes: 0
Views: 7869
Reputation: 4289
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.
Upvotes: 0
Reputation: 131
Do you have access to the Tomcat? You should inspect its log to find a reason of the error.
Upvotes: 0
Reputation: 1502746
I would take the following steps:
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.
Upvotes: 1