tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Calum <>
Subject Re: Null-pointer exception from response.encodeUrl under Windows Tomcat 7
Date Tue, 21 Jun 2011 08:26:42 GMT
On 20 June 2011 17:02, Christopher Schultz <> wrote:
> That depends on what Service.logHit does. If it only uses the
> HttpServletRequest object during the method's lifetime, then everything
> is fine. If it retains a reference to the request object, you will
> probably end up with a problem.

Oh, just gets the remoteAddr, requestURI, user-agent etc, and logs it
to a DB, for example.

> Tomcat re-uses the same request and response objects for a long time,
> and so multiple request processor threads will see the same object over
> the life of the server. If any of that code retains a reference to the
> request, by the time the object is re-referenced by the same code for
> whatever reason, the object will have "moved on" and will almost
> certainly be invalid (from the perspective of the code that cached it)
> and might /actually/ be invalid (because it is between requests and
> Tomcat has actively invalidated it).

I assume that Tomcat won't reuse a request/response until activity on
it has ended though?
Does it keep a pool of them?

Thanks for your help in clarifying this for me, by the way.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message