Tomcat 7.0.27 In ManagerBase an IllegalStateException is thrown when the configured maxActiveSessions attribute is exceeded. This allows no customized error handling via configuration in web.xml. See discussion: http://markmail.org/thread/xqjgdhf32gjrzjz2 Can be reproduced with the sample application: http://localhost:8080/examples/jsp/security/protected/index.jsp Just set maxActiveSession="0" in ${catalina.base}/conf/context.xml A configuration like this would be very useful: <error-page> <exception-type>org.apache.catalina.session.MaxActiveSessionsExceededException</exception-type> <location>/maxSessions.html</location> </error-page>
ManagerBase now throws o.a.c.session.TooManyActiveSessionsException, which is a subclass of IllegalStateException. Fixed in trunk and 7.0.x. Will be included in 7.0.28. Proposed for Tomcat 6.0.x.
Backport applied to 6.0 in r1353128 and will be in 6.0.36. I noted the following, while testing the patch for 6.0: 1). You will be able to configure custom error page for Servlets, such as http://localhost:8080/examples/servlets/servlet/SessionExample 2). You will not yet be able to configure it for JSP pages, such as http://localhost:8080/examples/jsp/num/numguess.jsp For JSP pages the error is swallowed and logged in JspPageContext#internalGetPageContext(..) and the user is presented with an empty page. Error handling does not happen. -> I filed bug 53460 for this issue.