简体   繁体   English

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

[英]Problems with a JAX-WS web service running under Tomcat 6.0.28

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. 我有一个JAX-WS Web服务,它已经在生产环境中运行了大约两个半月,并且一切似乎都运行良好。 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. 但是,在最近的几天中,我注意到似乎来自不同客户端的对Web服务的请求正在随机地混合在一起。 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. Web服务的正常运行时间应该是98.5%,而其他1.5%的时间似乎都在出现此问题。

When this occurs there are no errors written to the Tomcal logs. 发生这种情况时,不会将任何错误写入Tomcal日志。 The web service uses log4j and the log file for the web service also will have no exceptions when this occurs. 该Web服务使用log4j,并且当发生这种情况时,该Web服务的日志文件也将没有例外。

Thanks in advance for any help that you may be able to provide. 在此先感谢您可能提供的任何帮助。

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. 就像在servlet中一样,程序员必须确保代码是线程安全的,因此您必须确保Web服务中的代码是线程安全的。
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. 就像在servlet中一样,您的Web服务实现的单个实例将用于所有(并发)请求,因此您必须确保代码是线程安全的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM