在 Tomcat 6.0.28 下运行的 JAX-WS Web 服务出现问题

发布于 2024-10-10 08:03:45 字数 336 浏览 0 评论 0原文

我有一个 JAX-WS Web 服务,它已经在生产环境中运行了大约两个半月,一切似乎都运行得很完美。然而,在过去的几天里,我注意到来自不同客户端的对 Web 服务的请求似乎随机混合在一起。当发生这种情况时,当前正在处理的一个请求会以某种方式被第二个请求中断,并且第二个请求在第一个请求之前完成处理,并且第二个请求的响应被发送到第一请求者和第二请求者。 Web 服务在 98.5% 的时间内完全按照预期工作,而在另外 1.5% 的时间内似乎会出现此问题。

发生这种情况时,Tomcal 日志中不会写入任何错误。 Web 服务使用 log4j,发生这种情况时,Web 服务的日志文件也不会出现异常。

预先感谢您能够提供的任何帮助。

I have a JAX-WS web service that has been running in a production environment for about two and a half months now and everything seemed to be running perfectly. However, in the last few days I have noticed that it appears that requests to the web service from different clients are becoming intermingled at random. When this happens one request that is currently being processed gets interrupted somehow by second request and the second request completes processing before the first request and the response for the second request is sent to both the first and second requester. The web service works exactly as it's supposed to 98.5% of the time and the other 1.5% of the time this problem seems to be showing up.

When this occurs there are no errors written to the Tomcal logs. The web service uses log4j and the log file for the web service also will have no exceptions when this occurs.

Thanks in advance for any help that you may be able to provide.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

嗳卜坏 2024-10-17 08:03:45

从描述来看,这听起来像是线程问题。
就像在 servlet 中一样,程序员必须确保代码是线程安全的,因此您必须确保 Web 服务中的代码是线程安全的。
就像在 servlet 中一样,Web 服务实现的单个实例将用于所有(并发)请求,因此您必须确保代码是线程安全的。

From the description this sounds like a threading issue.
Just like in servlets where the programmer must make sure that the code is thread safe so you must make sure that the code in your web service is thread safe.
Just like in servlets, a single instance of you web service implementation will be used for all (concurrent) requests so you must make sure that your code is thread safe.

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