We just upgraded from Tomcat 5.0.x to 5.5.26. In Tomcat 5.0.x, the following code returned NULL to obj: HttpSession session = request.getSession(true); Object obj = session.getAttribute(null); In Tomcat 5.5.26, that same code raises this exception: java.lang.NullPointerException java.util.Hashtable.get(Unknown Source) org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1024) org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:110) NewServlet.processRequest(NewServlet.java:29) NewServlet.doGet(NewServlet.java:52) javax.servlet.http.HttpServlet.service(HttpServlet.java:690) javax.servlet.http.HttpServlet.service(HttpServlet.java:803) I know how to code around it, but doesn't this qualify as a bug, at least for regression purposes? FYI: I'm using JDK 5.
The spec is non-specific in this case. You could argue this either way but the fix should be trivial. I'll take a look.
This has been fixed in trunk and proposed for 6.0.x and 5.5.x Thanks for the report.
This has been fixed in 6.0.x and will be included in 6.0.17 onwards.
This has been fixed in 5.5.x and will be included in 5.5.27 onwards.