|
| Problem | The exception, java.lang.IllegalStateException, is thrown by the Session Manager if the session object is not valid. | | Cause | The following methods will all throw the IllegalStateException, shown below, if the session object is not valid:[02.11.15 04:05:54:500 PST] 3ced77c6 ServletInstan X Uncaught service() exception root cause {0}: {1} "LoginServlet"
java.lang.IllegalStateException:
Session Object Internals:
id : QJP45EI1FEA0XAOKNVSDENA
hashCode : 1681586149
create time : Fri Nov 15 04:04:03 PST 2002
last access : Fri Nov 15 04:05:26 PST 2002
max inactive interval : 3600
user name : anonymous
valid session : false
new session : false
session active : false
overflowed : false
session application parameters :
enable epm : true
non-serializable app specific session data: {loginData=com.bb.toys.bobject.Data@9bf4f7e6}
serializable app specific session data : {previousPage=login}
session data list : Session Data List ->id : MRU next : null prev : null
at
com.ibm.servlet.personalization.sessiontracking.SessionData.putValue
at
com.ibm.servlet.personalization.sessiontracking.SessionData.setAttribute
at
com.bb.toys.servlet.LoginServlet.doPost(LoginServlet.java
at
javax.servlet.http.HttpServlet.service | | Solution | There are two known ways for this exception to occur:
1. Application invalidates session and then tries to access it on the same request
The following steps occur within the same request:HttpSession mySession = request.getSession(); - The method,
mySession.invalidate() , is called. - One of the following methods is called on the session object:
mySession.putValue(myString, "is the session invalid"); mySession.getValue(myString); mySession.removeValue(myString); mySession.isNew(); - Any other attempted operation on the session object.
Check the servlet or JavaServer™ Pages (JSP™) that threw the exception to determine if the scenario described above applies to your situation. If not, continue to the next section.
2. Two threads within the JVM™ both gain access to the session object. One thread invalidates the session and then the other thread attempts to use the session object
- Application code in Thread-1 gains access to the session object by calling:
HttpSession mySession = request.getSession(); |
|
- Application code in Thread-2 gains access to the same session object by calling:
HttpSession mySession = request.getSession(); |
|
- Thread-2 invalidates the session object.
- Thread-1 attempts to use the session object by calling one of the following methods:
mySession.putValue(myString, "is the session invalid"); mySession.getValue(myString); mySession.removeValue(myString); mySession.isNew(); - Any other attempted operation on the session object.
| | | | |
| |
|
Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, Sessions and Session Management Operating system(s): Multi-Platform Software version: 3.5, 3.5.1, 3.5.2, 3.5.3, 3.5.4, 3.5.4.1, 3.5.4.2, 3.5.5, 3.5.6, 3.5.7, 4.0, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5, 4.0.6, 4.0.7, 5.0, 5.0.1, 5.0.2, 5.0.2.1, 5.0.2.2, 5.0.2.3, 5.0.2.4, 5.0.2.5, 5.0.2.6, 5.1, 5.1.0.1, 5.1.0.2, 5.1.0.3, 5.1.0.4, 5.1.0.5, 5.1.1 Software edition: Advanced, Single Server, Standard Reference #: 1082806 IBM Group: Software Group Modified date: 2004-07-16
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
|