views:

221

answers:

2

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.

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?

+1  A: 

Any ideas on fixing this?

Upgrade JBoss.

BalusC
Thanks, but if that was an option I would have done it.
oconnor0
Another option is to retrieve/externally-configure/hardcode it once and store/use it as applicationwide variable.
BalusC
We'll be upgrading the version of JBoss soon.I also tried calling request.getServerName() until I get non-null back.
oconnor0
A: 

I'm probably missing something obvious, but .... if they're all on the same instance/server, then why do you need to pull the server name programmatically - why not just have it in a config file?

Amber Shah
oconnor0