java.io.IOException:服务器返回 HTTP 响应代码:500 对于 URL:https://hostname:port/xxx.do

发布于 2024-09-28 19:58:46 字数 676 浏览 6 评论 0原文

对于以下用于 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

绿萝 2024-10-05 19:58:46

我将采取以下步骤:

  • 从浏览器尝试相同的 URL,最好是在几个不同的盒子和浏览器上
  • 使用 Wireshark 来查看网络上发生的情况
  • 尝试针对调试器运行小程序,以查看您的代码是否实际上被调用

基本上这根本不可能是客户端问题,除非像代理这样的东西妨碍并把事情搞砸了。 WireShark 将向您显示网络上发生的情况...如果它确实正在访问您的代码,调试应该可以帮助您找出服务器中发生的情况,并希望了解为什么它没有进入您的代码Tomcat 日志。

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.

只涨不跌 2024-10-05 19:58:46

您可以访问 Tomcat 吗?您应该检查其日志以查找错误原因。

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

我要还你自由 2024-10-05 19:58:46

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文