Null Pointer Exception when 404 status code comes

1.2k Views Asked by At

i am using Resin 3.1.6 and Struts 2.1.8.1. When a page not found error (404) is returned, I am getting NullPointerException. Here is a stack trace.

java.lang.NullPointerException
    at com.caucho.server.connection.RequestWrapper.isSecure(RequestWrapper.java:296)
    at com.caucho.server.connection.RequestAdapter.getCookieName(RequestAdapter.java:463)
    at com.caucho.server.connection.RequestAdapter.getSession(RequestAdapter.java:387)
    at com.caucho.server.webapp.DispatchRequest.getSession(DispatchRequest.java:448)
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:236)
    at org.springframework.web.context.request.ServletRequestAttributes.updateAccessedSessionAttributes(ServletRequestAttributes.java:222)
    at org.springframework.web.context.request.AbstractRequestAttributes.requestCompleted(AbstractRequestAttributes.java:48)
    at org.springframework.web.context.request.RequestContextListener.requestDestroyed(RequestContextListener.java:78)
1

There are 1 best solutions below

0
On

It looks like (from the code) you don't have a session for these calls. Are you getting a session timeout, or possibly a session isn't being created for pages which would cause a 404.