Mantis - Resin
Viewing Issue Advanced Details
5252 minor have not tried 10-22-12 04:01 10-22-12 10:08
closed 4.0.31  
none 4.0.33  
0005252: NPE during getSession()
We've bumped into a NPE when trying to access the Session for a given request. The relevant section of the stacktrace is given. The simple fix would be to check to see if the request is non-null inside getCookies().

at com.caucho.server.http.HttpServletRequestImpl.getCookies(
at com.caucho.server.http.HttpServletRequestImpl.findCookie(
at com.caucho.server.http.HttpServletRequestImpl.getCookie(
at com.caucho.server.http.HttpServletRequestImpl.findSessionIdFromCookie(
at com.caucho.server.http.HttpServletRequestImpl.getRequestedSessionId(
at com.caucho.server.http.HttpServletRequestImpl.getSessionId(
at com.caucho.server.http.AbstractCauchoRequest.createSession(
at com.caucho.server.http.AbstractCauchoRequest.getSession(

As an aside, I think this is a race condition due to:

 - The caucho layer tears down a session at some point and an event is fired to let the application layer know of a session tear down.
 - Our application layer has a reaper-thread to detect timed-out sessions.
 - I think the caucho layer has invalidated the session and then fired the session-invalidated event, but we have tried to access that session before we have received that invalidation event.

There are no notes attached to this issue.