Skip to content

session object is null, but not always. #100

@angad-rajput-qp

Description

@angad-rajput-qp

I am using resin as a web server and hazelcast-wm 4.0 and hazelcast 4.0
I receive a NullPointerException on the session object. The error does not reappear after we refresh.
The session object is randomly null for the first time.

Code in a JSP:

user = (User) session.getAttribute("user");

Error:

java.lang.NullPointerException
                                                       	at _jsp._jsp._user._socialNetworksites__jsp._jspService(_socialNetworksites__jsp.java:1444)
                                                       	at _jsp._jsp._user._socialNetworksites__jsp._jspService(_socialNetworksites__jsp.java:1393)
                                                       	at com.caucho.jsp.JavaPage.service(JavaPage.java:64)
                                                       	at com.caucho.jsp.Page.pageservice(Page.java:548)
                                                       	at com.caucho.server.dispatch.PageFilterChain.doFilter(PageFilterChain.java:194)
                                                       	at com.hazelcast.web.WebFilter.doFilter(WebFilter.java:305)
                                                       	at com.caucho.server.dispatch.FilterFilterChain.doFilter(FilterFilterChain.java:89)
                                                       	at com.caucho.server.httpcache.ProxyCacheFilterChain.doFilter(ProxyCacheFilterChain.java:161)
                                                       	at com.caucho.server.webapp.DispatchFilterChain.doFilter(DispatchFilterChain.java:131)
                                                       	at com.caucho.server.dispatch.ServletInvocation.service(ServletInvocation.java:314)
                                                       	at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:440)
                                                       	at com.caucho.server.webapp.RequestDispatcherImpl.include(RequestDispatcherImpl.java:359)
                                                       	at com.hazelcast.web.WebFilter$HazelcastRequestWrapper$1.include(WebFilter.java:370)
                                                       	at com.hazelcast.web.WebFilter$HazelcastRequestWrapper$1.include(WebFilter.java:370)
                                                       	at com.hazelcast.web.WebFilter$HazelcastRequestWrapper$1.include(WebFilter.java:370)
                                                       	at com.caucho.jsp.PageContextImpl.include(PageContextImpl.java:1091)
                                                       	at _jsp._jsp._user._qp_22dlogin__jsp._jspService(_qp_22dlogin__jsp.java:1609)
                                                       	at _jsp._jsp._user._qp_22dlogin__jsp._jspService(_qp_22dlogin__jsp.java:1394)

the session is null in the above case.

--EDIT--

I tried fetching "request.getSession(true)" and it gave me null randomly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions