Mantis - Resin
Viewing Issue Advanced Details
6123 minor always 01-02-18 13:20 01-02-18 14:52
ferg  
ferg  
normal  
closed  
fixed  
none    
none 4.0.56  
0006123: NPE in access log
(rep by Steffen Busch)

now with Resin 4.0.54 we can see the Stack Trace that happens in this siutation:


com.caucho.server.webapp.WebApp java.lang.NullPointerException
                             at com.caucho.server.http.AbstractCauchoRequest.getSessionCookie(AbstractCauchoRequest.java:771)
                             at com.caucho.server.http.HttpServletRequestImpl.getCookies(HttpServletRequestImpl.java:940)
                             at com.caucho.server.http.HttpServletRequestImpl.findCookie(HttpServletRequestImpl.java:988)
                             at com.caucho.server.http.HttpServletRequestImpl.getCookie(HttpServletRequestImpl.java:983)
                             at com.caucho.server.log.AccessLog.log(AccessLog.java:477)
                             at com.caucho.server.log.AccessLog.log(AccessLog.java:416)
                             at com.caucho.server.webapp.WebApp.accessLog(WebApp.java:4519)
                             at com.caucho.server.http.AbstractHttpRequest.sendRequestError(AbstractHttpRequest.java:1748)
                             at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:861)
                             at com.caucho.network.listen.TcpSocketLink.dispatchRequest(TcpSocketLink.java:1353)
                             at com.caucho.network.listen.TcpSocketLink.handleRequest(TcpSocketLink.java:1309)
                             at com.caucho.network.listen.TcpSocketLink.handleRequestsImpl(TcpSocketLink.java:1293)
                             at com.caucho.network.listen.TcpSocketLink.handleRequests(TcpSocketLink.java:1201)
                             at com.caucho.network.listen.TcpSocketLink.handleAcceptTaskImpl(TcpSocketLink.java:997)
                             at com.caucho.network.listen.TcpSocketLink.handleAcceptTask(TcpSocketLink.java:949)
                             at com.caucho.network.listen.ConnectionTask.runThread(ConnectionTask.java:114)
                             at com.caucho.network.listen.ConnectionTask.run(ConnectionTask.java:93)
                             at com.caucho.network.listen.SocketLinkThreadLauncher.handleTasks(SocketLinkThreadLauncher.java:169)
                             at com.caucho.network.listen.TcpSocketResumeThread.run(TcpSocketResumeThread.java:62)
                             at com.caucho.env.thread2.ResinThread2.runTasks(ResinThread2.java:173)
                             at com.caucho.env.thread2.ResinThread2.run(ResinThread2.java:118)



I think it could be triggered with an access-log configuration inside <host-default> that contains %{mycookie}c in the format= element.

A BadRequest could be done with for example http://example.com/..wp-admin [^]


Would it be possible to fix this - e.g. with returning "" or null rather than the NullPointerException when AccessLog want's to get the Cookies but there is no sessionManager available?



Notes
(0006814)
ferg   
01-02-18 14:52   
server/02f1