On 10/21/18, 8:22 AM, "Mark Thomas" <[email protected]> wrote:
> Tomcat recycles HttpServletRequest objects. If an application retains a
reference to a request then you can see the behaviour you describe.
> Setting the following system property:
> org.apache.catalina.connector.RECYCLE_FACADES=true
> will cause Tomcat to create a new wrapper for each request/response.
...
---
I checked our bin/setenv.sh, this is already set to true on our Tomcat Servers.
CATALINA_OPTS="... -Dorg.apache.catalina.connector.RECYCLE_FACADES=true ..."
Are there any other possible causes, or steps I could take to troubleshoot this?
Thanks,
Dustin
Tomcat recycles HttpServletRequest objects. If an application retains a
reference to a request then you can see the behaviour you describe.
Setting the following system property:
org.apache.catalina.connector.RECYCLE_FACADES=true
will cause Tomcat to create a new wrapper for each request/response.
This has two advantages. One it should stop one request seeing data from
another. Two it should trigger an NPE when the application tries to
access to request/response that has been retained after it should have
been discarded.
Mark
>
> -------
> public class AccessLogFilter implements Filter {
>
> private static final Logger log =
LoggerFactory.getLogger(AccessLogFilter.class);
>
> public AccessLogFilter() {}
>
> public void doFilter(ServletRequest request, ServletResponse
response, FilterChain chain) throws IOException, ServletException {
> HttpServletRequest httpServletRequest = (HttpServletRequest)
request;
>
> StringBuilder message = new StringBuilder();
> message.append("StartTime=\"" + getTimestamp()+"\"");
> message.append(" requestURI=\"" +
httpServletRequest.getRequestURI() + "\"");
> ...
> chain.doFilter(request, response);
> log.info(message.toString());
> }
> ...
> ------
>
> StackTrace @ AccessLogFilter
> 1. DoFilter -> AccessLogFilter (Our new filter)
> 2. InternalDoFilter -> Application Filter Chain (org.apache.catalina.core)
> 3. Invoke -> StandardWrapperValue (org.apache.catalina.core)
> 4. Invoke -> StandardContextValue (org.apache.catalina.core)
> 5. Invoke -> AuthenicatorBase (org.apache.catalina.authenicator)
> ... (All related to org.apache.*, until we hit the java concurrency
frames for the thread)
>
> -----
>
>
>
> Thanks,
> Dustin
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]