Bug 53230 - Allow custom error mapping when Manager's maxActiveSessions is exceeded
Allow custom error mapping when Manager's maxActiveSessions is exceeded
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.27
PC All
: P2 enhancement (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-05-14 17:09 UTC by Thomas Rohde
Modified: 2012-06-23 14:04 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Rohde 2012-05-14 17:09:13 UTC
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>
Comment 1 Christopher Schultz 2012-06-06 00:03:25 UTC
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.
Comment 2 Konstantin Kolinko 2012-06-23 14:04:23 UTC
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.