File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes java.lang.IllegalStateException: createSession: Too many active session; getting redirected to blank Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "java.lang.IllegalStateException: createSession: Too many active session; getting redirected to blank" Watch "java.lang.IllegalStateException: createSession: Too many active session; getting redirected to blank" New topic
Author

java.lang.IllegalStateException: createSession: Too many active session; getting redirected to blank

Ravi Avisa
Greenhorn

Joined: Dec 11, 2012
Posts: 1
Hi All

I am getting a blank web page,instead of redirecting to Error.html, when a user is trying to access login page.
this is happening when number of user are exceeding maxActiveSession.


entries in context.xml file
---------------------------------------------------------------------------------------------
<Context>
<Manager className='org.apache.catalina.session.StandardManager' maxActiveSessions='1'
pathname=""
>
</Manager>
</Context>
-------------------------------------------------------------------------

Entries in Web.xml
---------------------------------------------------------------------------
<error-page>
<exception-type>java.lang.IllegalStateException</exception-type>
<location>/error.html</location>
</error-page>
<security-constraint>
<web-resource-collection>

<web-resource-name>native</web-resource-name>
<description>Web application</description>
<url-pattern>/index.jsp</url-pattern>
<url-pattern>/pages/*</url-pattern>
<url-pattern>/modules/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>Web Client Users</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>FORM</auth-method>
<realm-name>NATIVE</realm-name>
<form-login-config>
<form-login-page>/login.jsp</form-login-page>
<form-error-page>/login_failed.jsp</form-error-page>
</form-login-config>
</login-config>
<security-role>
<role-name>Web Client Users</role-name>
</security-role>
-----------------------------------------------------------------------------------------------

This error displayed jboss console
--------------------------------------------------------------------------------------------------

2012-12-11 17:09:44,373 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.IllegalStateException: createSession: Too many active sessions
at org.apache.catalina.session.StandardManager.createSession(StandardManager.java:286)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2206)
at org.apache.catalina.connector.Request.getSessionInternal(Request.java:2150)
at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:230)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:446)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:619)

Please suggest how to redirect to error page, when maxActivesessions have exceeded the limit

Thanks
AvisaRavi
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Ravi, welcome to JavaRanch

moving appropriate forum to get better response
 
Don't get me started about those stupid light bulbs.
 
subject: java.lang.IllegalStateException: createSession: Too many active session; getting redirected to blank