from time to time i find the following error messages in the log-files of my production system: java.lang.NullPointerException at org.apache.catalina.session.StandardSession.removeAttribute(Ljava.lang.String;Z)V(StandardSession.java:1157) at org.apache.catalina.session.StandardSession.removeAttribute(Ljava.lang.String;)V(StandardSession.java:1103) at org.apache.catalina.session.StandardSessionFacade.removeAttribute(Ljava.lang.String;)V(StandardSessionFacade.java:201) at org.apache.catalina.session.StandardSessionFacade.removeAttribute(Ljava.lang.String;)V(StandardSessionFacade.java:201) unfortunatly i could never cause the error by myself, i just see it happen by looking in the log-files. digging into the source-code of removeAttribute points to these lines: // Notify interested application event listeners Context context = (Context) manager.getContainer(); Object listeners[] = context.getApplicationListeners(); the null-pointer-exception is thrown in the line that calls manager.getContainer(), so it seems manager is null, when it comes to the exception. i don't know how manager can get null -- maybe i have some miscounfiguration? so without understanding the details or the implementation, i looked at the other methods that access manager. most of then check the manager-variable for a null-value before they access it. so maybe this should be done here too?
Please add the rest of the stack trace.
There has been no response after a month so I am closing this as invalid. I have reviewed the relevant source code and can't see a path where manager could be null in normal usage. I suggest that the best place to follow up on this is the tomcat-user mailing list (with the full stack trace as a starting point). If that discussion concludes that there is a bug, this bug report can always be re-opened.