java.io.IOException:服务器返回 HTTP 响应代码:500 对于 URL:https://hostname:port/xxx.do
对于以下用于 applet-servlet 通信的代码,我们收到“java.io.IOException:服务器返回 HTTP 响应代码:URL 500”错误。相同的代码已经工作了很长时间,现在突然我们看到这个错误。会不会是tomcat设置有问题? Tomcat 日志没有显示任何错误。异常在指向这段代码的java控制台上抛出。有没有好的方法来调试这个错误代码?
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();
任何帮助将不胜感激。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我将采取以下步骤:
基本上这根本不可能是客户端问题,除非像代理这样的东西妨碍并把事情搞砸了。 WireShark 将向您显示网络上发生的情况...如果它确实正在访问您的代码,调试应该可以帮助您找出服务器中发生的情况,并希望了解为什么它没有进入您的代码Tomcat 日志。
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.
您可以访问 Tomcat 吗?您应该检查其日志以查找错误原因。
Do you have access to the Tomcat? You should inspect its log to find a reason of the error.
500 内部服务器错误是服务器上的错误,而不是客户端上的错误。如果您的程序是客户端,则除了告诉服务器管理员修复它之外,您无法修复此问题。
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.