Re: WAS6.1 - session.getAttribute( xxx) throwing a null pointer exception!
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > WebSphere > WebSphere Application Server > Re: WAS6.1 - session.getAttribute( xxx) throwing a null pointer exception!




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Re: WAS6.1 - session.getAttribute( xxx) throwing a null pointer exception!  
Paul Ilechko


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
07-22-07 12:18 AM

narasimha@vwebsol.com wrote:
> I am getting a Null Pointer Exception upon trying to access a session variable. Pl
ease note this issue is not the same as the session object being null or session var
iable being null. But here, trying to execute the line session.getAttribute itself t
hro
ws a null pointer with the below stack.
>
> =========================
> java.lang.NullPointerException
> 	at java.util.Hashtable.get(Hashtable.java:481)
> 	at com.ibm.ws.webcontainer.srt.SRTRequestContext.getSession(SRTRequestCon
text.java:76)
> 	at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletReq
uest.java:1239)
> 	at com.ibm.ws.webcontainer.srt.SRTServletRequest.getSession(SRTServletReq
uest.java:1226)
> 	at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletReq
uestWrapper.java:268)
> 	at com.ema.appfw.ui.web.AbstractMultiActionController.getUserSession(Abst
ractMultiActionController.java:37)
> ===========================
>
> The issue remains even if you request a new session (request.getSession(tr
ue)). Below is the Java code.
>
>         if(request.getSession() != null) {
>             if(request.getSession().getAttributeNames() != null && request
.getSession().getAttributeNames().hasMoreElements())
>                 //get userSessionToken from Session
>                 userSession = (UserSession)request.getSession().getAttribu
te( AppConstants.USER_SESSION );
>         }
>
> The issue occurs quite consistently on few requests after a little working with th
e application. In the sense, the user logs in, performs operation1, goes ahead to pe
rform few other operations and then when he comes back to operation1 link, he gets t
he
above null pointer. It occurs with just single user session.
>
> Can anyone throw some light on the issue? Am I missing something in the ap
plication code or Websphere setting?
>


WAG - you're going from a protected to an unprotected page, and no
longer have access to a secure session.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 09:51 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register