On 17/07/17 09:59, Matthias Keller wrote: > Hi > > In our production environment we (sometimes but still often enough) have > the problem, that we get an NPE deep within the Response object. > > This occurs under 8.5.13 and 8.5.16. > > The stacktrace (from 8.5.13) is as follows: > > org.apache.catalina.connector.Response.generateCookieString(Response.java:999) > org.apache.catalina.connector.Response.addCookie(Response.java:947) > org.apache.catalina.connector.ResponseFacade.addCookie(ResponseFacade.java:386) > javax.servlet.http.HttpServletResponseWrapper.addCookie(HttpServletResponseWrapper.java:58) > javax.servlet.http.HttpServletResponseWrapper.addCookie(HttpServletResponseWrapper.java:58) > javax.servlet.http.HttpServletResponseWrapper.addCookie(HttpServletResponseWrapper.java:58) > > The code leading to it is: > > Cookie c = new Cookie(cookieName, ""); > c.setMaxAge(0); > cookie.setPath(contextPath); > response.addCookie(cookie); > > We use the LegacyCookieProcessor via tomcat's context.xml: > > <CookieProcessor > className="org.apache.tomcat.util.http.LegacyCookieProcessor" /> > > It appears that the context object is null in those cases (which I can > confirm using the debugger), but I have no clue as of why this could be > happening? Especially since it doesn't happen every time. > > Any clues or hints? What could I do to debug this problem?
Where / when is this code running? How are you obtaining the response object? > BTW this doesn't happen on Tomcat 7.0.77 That might be timing related. There was a lot of refactoring of the Connector code between 7.0.x and 8.5.x. Mark --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org