tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 53460] New: Use error handling when TooManyActiveSessionsException happens in JSP
Date Sat, 23 Jun 2012 14:02:41 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=53460

          Priority: P2
            Bug ID: 53460
          Assignee: dev@tomcat.apache.org
           Summary: Use error handling when TooManyActiveSessionsException
                    happens in JSP
          Severity: normal
    Classification: Unclassified
                OS: Windows XP
          Reporter: knst.kolinko@gmail.com
          Hardware: PC
            Status: NEW
           Version: 7.0.28
         Component: Jasper
           Product: Tomcat 7

I noticed this while testing the fix for bug 53230 in Tomcat 6.

To reproduce:
1. Limit the count of active sessions supported by session manager, by adding
the following line to conf/server.xml:

<Manager maxActiveSessions="0" />

2. Start Tomcat and access the NumGuess example:

http://localhost:8080/examples/jsp/num/numguess.jsp


Actual result:
- Blank page.
- An error (SEVERE) is logged by JspFactoryImpl.internalGetPageContext(),
where this exception is swallowed.

Expected result:
- Error page.
- This expected issue does not deserve severe logging.

Note, that simply rethrowing it in JspFactoryImpl.internalGetPageContext() will
not help, as will be further swallowed by Java code of JSP page and proper
error handling there does not happen without a PageContext instance - see
r1347100 for related fix.

Maybe create PageContext instance and initialize session in two separate calls?
So that if session initialization fails, it could be handled by that
PageContext instance.


Stack trace:
(trunk, running with SecurityManager enabled)
[[[
23-Jun-2012 17:28:20.937 SEVERE [http-apr-8080-exec-2]
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext Exception
initializing page context
 org.apache.catalina.session.TooManyActiveSessionsException: createSession: Too
many active sessions
    at
org.apache.catalina.session.ManagerBase.createSession(ManagerBase.java:616)
    at org.apache.catalina.connector.Request.doGetSession(Request.java:2687)
    at org.apache.catalina.connector.Request.getSession(Request.java:2119)
    at
org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedAction.run(RequestFacade.java:217)
    at
org.apache.catalina.connector.RequestFacade$GetSessionPrivilegedAction.run(RequestFacade.java:206)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:895)
    at
org.apache.catalina.connector.RequestFacade.getSession(RequestFacade.java:910)
    at
org.apache.jasper.runtime.PageContextImpl._initialize(PageContextImpl.java:146)
    at
org.apache.jasper.runtime.PageContextImpl.initialize(PageContextImpl.java:125)
    at
org.apache.jasper.runtime.JspFactoryImpl.internalGetPageContext(JspFactoryImpl.java:112)
    at
org.apache.jasper.runtime.JspFactoryImpl.access$000(JspFactoryImpl.java:41)
    at
org.apache.jasper.runtime.JspFactoryImpl$PrivilegedGetPageContext.run(JspFactoryImpl.java:156)
    at
org.apache.jasper.runtime.JspFactoryImpl$PrivilegedGetPageContext.run(JspFactoryImpl.java:129)
    at java.security.AccessController.doPrivileged(Native Method)
    at
org.apache.jasper.runtime.JspFactoryImpl.getPageContext(JspFactoryImpl.java:63)
    at org.apache.jsp.jsp.num.numguess_jsp._jspService(numguess_jsp.java:54)

]]]

-- 
You are receiving this mail because:
You are the assignee for the bug.

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


Mime
View raw message