uCosminexus Application Server, Web Container Functionality Guide
With Application Server, you can set an upper limit for the number of valid HttpSession objects.
Set the upper limit for HTTPSession objects as the property of the Web applications contained in a J2EE application. For details on the settings for the J2EE applications, see 2.7.7 Definition in cosminexus.xml.
- Note
- If the session failover functionality is applied to the Web applications, you must set the upper limit for the number of HTTP sessions when the following settings are made.
- Settings for canceling the start processing of the Web application (webserver.dbsfo.negotiation.high_level key of the Easy Setup definition file) when the negotiation processing during the startup of the application fails.
- In this case, if the upper limit is not set for the number of HTTP sessions, an error occurs when you start the Web application that inherits the session information and you cannot start the Web application. If you have specified the settings for continuing the startup processing of the Web application when the negotiation processing during the startup of the application fails, the settings of the upper limit of the number of HttpSession objects is optional.
- For the session failover functionality, see 5.2 Overview of the session failover functionality in the uCosminexus Application Server Expansion Guide.
- For the negotiation processing of the session failover functionality during the startup of a Web application, see 6.4.1 Processing at the time of starting an application in the uCosminexus Application Server Expansion Guide.
- For the Easy Setup definition file and the parameters to be specified, see 4.6 Easy Setup definition file in the uCosminexus Application Server Definition Reference Guide.
- Reference note
- When the size estimation functionality of the global session information is enabled, the upper limit for the number of HttpSession objects that is the prerequisite for the session failover functionality is not required to be specified. For the size estimation functionality of the global session information, see 6.5 Estimating the size of the global session information in the uCosminexus Application Server Maintenance and Migration Guide.
- Organization of this subsection
- (1) HttpSession objects for which upper limit is to be set
- (2) Operations when the number of HttpSession objects exceeds the upper limit (Occurrence of exception)
- (3) Operations when the number of HttpSession objects exceeds the upper limit (message output)
(1) HttpSession objects for which upper limit is to be set
The upper limit is set for enabled HttpSession objects.
Among the HttpSession objects acquired by the getSession method of the javax.servlet.http.HttpServletRequest interface, valid HttpSession objects implies the objects that satisfy the following two conditions:
- Objects in which the timeout does not occur
- Objects in which the invalidate method is not called
(2) Operations when the number of HttpSession objects exceeds the upper limit (Occurrence of exception)
If the upper limit for the number of HttpSession objects is specified and if an attempt is made to generate HttpSession objects exceeding the specified upper limit, an exception occurs in the getSession method of the javax.servlet.http.HttpServletRequest interface. Depending on the settings, one of the following exceptions will occur:
- java.lang.IllegalStateException
- com.hitachi.software.web.session.HttpSessionLimitExceededException that is an inherited class of java.lang.IllegalStateException
Specify which exception will be thrown in the J2EE application parameters. For details on the settings for the J2EE applications, see 2.7.8(1) Setting up the J2EE server.
The HttpSession object is generated at the following timing in the Web Container:
- JSP execution time
Indicates the cases in which JSP is executed when true is specified in the session attribute of the page directive or when the session attribute is omitted.
- When a URL requiring FORM authentication is accessed.
If the HttpSession object generation process exceeds the specified upper limit, perform the following operations:
- When the upper limit is exceeded during execution of JSP
java.lang.IllegalStateException or com.hitachi.software.web.session.HttpSessionLimitExceededException is thrown before execution of user code of JSP.
- When the upper limit is exceeded during access to a URL that requires FORM authentication
java.lang.IllegalStateException or com.hitachi.software.web.session.HttpSessionLimitExceededException is thrown before a request is transferred to the page for logging in.
- Hint
- If the com.hitachi.software.web.session.HttpSessionLimitExceededException class is used, add Cosminexus-installation-directory/CC/lib/ejbserver.jar in the class path when the J2EE applications are developed, and compile the Java program.
(3) Operations when the number of HttpSession objects exceeds the upper limit (message output)
If the upper limit for the number of HttpSession objects is specified and if an attempt is made to generate HttpSession objects exceeding the specified upper limit, the KDJE39225-E message is output to the log.
The message KDJE39225-E is output every time the request that uses HTTP session is executed, therefore, the log might be filled up with the same message. To restrain the repeated output of the same message, you can set the interval (output interval) for KDJE39225-E. Set the interval as required. This interval is applied to each Web application.
For the message output interval settings, see 2.7.8(1) Setting up the J2EE server.
All Rights Reserved. Copyright (C) 2013, Hitachi, Ltd.