You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2004/03/22 22:37:56 UTC

DO NOT REPLY [Bug 27859] New: - NPE in ApplicationHttpRequest.getSession

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=27859>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=27859

NPE in ApplicationHttpRequest.getSession

           Summary: NPE in ApplicationHttpRequest.getSession
           Product: Tomcat 5
           Version: 5.0.19
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jdane@hawaii.edu


I've just been setting up a fairly complex series of webapp.  In the process I got the following 
exceptino and stack trace:

java.lang.NullPointerException
        at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:546)
        at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:512)
        at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:268)
        ...

the offending code is:

            if (other != null) {
                Session localSession = null;
                try {
                    localSession =
                        context.getManager().findSession(other.getId());
		    localSession.access();      <--- NPE here
                } catch (IOException e) {
                    // Ignore
                }

localSession above can be null, hence the NPE.

it might be that there was something wrong with the configuration I was using that triggered this.  still 
seems like a bug, tho, since the docs for Manager.getSession explicitly allow it to return null.

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org