HttpServletRequest.getServerName()在并发使用中偶尔返回null吗? [英] HttpServletRequest.getServerName() occasionally returning null in concurrent use?

查看:428
本文介绍了HttpServletRequest.getServerName()在并发使用中偶尔返回null吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在JBoss 4.0.1SP1中,我有一个servlet,它对在同一实例下运行的Web服务进行多个并发调用。我正在使用request.getServerName()(在HttpServletRequest上)构造端点URL。这通常可以正常工作,但偶尔会返回null。

Under JBoss 4.0.1SP1, I have a servlet that makes multiple, concurrent calls to web services that are running under the same instance. I'm using request.getServerName() (on HttpServletRequest) to construct the endpoint URL. This normally works fine, but every once in a while returns null.

在并行运行Web服务请求之前,我没有看到此消息,因此我猜想共享

I hadn't seen this before running the web service requests in parallel, and so I guessed that sharing the HttpServletRequest among threads won't always work or something.

是否有解决此问题的想法?

Any ideas on fixing this?

推荐答案


是否有解决此问题的想法?

Any ideas on fixing this?

升级JBoss。

这篇关于HttpServletRequest.getServerName()在并发使用中偶尔返回null吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆