when I invalidate http session it threw an null pointer exception something like below :
Dec 14, 2012 9:49:52 PM org.apache.catalina.session.StandardSession expire
SEVERE: Session event listener threw exception
java.lang.NullPointerException
suggest.
Put some breakpoints in your code and use your favorite IDE in DEBUG mode to confirm if this ‘session’ reference variable is pointing to a null object.
Then, just check the documentation to clarify all the details surrounding the getSession() method (it might give you some ideas): http://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpServletRequest.html#getSession%28boolean%29