`

tomcat 异常 Exception loading sessions from persistent storag

阅读更多
启动Tomcat时出现session persistence问题,抛出类似如下异常信息:
ERROR:IOException while loading persisted sessions: java.io.WriteAbortedException: writing aborted;
ERROR:
Exception loading sessions from persistent storage

可尝试办法:
修改Tomcat\conf\server.xml,添加如下内容
<context></context>
<manager classname="org.apache.catalina.session.PersistentManager" saveonrestart="false"></manager>

参考原因:在Session里面放置了com.abc.UserBean对象,这个类也没有实现java.io.Serializable。
User authentication information is stored both in the users's session data and in the context of a server or virtual host that is targeted by a Web Application. Using the session.invalidate() method, which is often used to log out a user, only invalidates the current session for a user—the user's authentication information still remains valid and is stored in the context of the server or virtual host. If the server or virtual host is hosting only one Web Application, the session.invalidate()method, in effect, logs out the user.

 

J2ee的session并没有要求session attribute必须要Serializable呀。原来这是tomcat 5的新功能,服务复位后自动恢复session

如果要禁用这一特性,到apache-tomcat/conf/Catalina/localhost目录下找到webapp同名的xml,修改成:

 <Context path="..." reloadable="..." docBase="..." workDir="..."> 
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/> 
</Context> 
 

评论
3 楼 star022 2009-11-21  
很有个性~~
2 楼 我奋斗 2009-07-24  
我也觉得,混江湖的吧。
1 楼 wenjinglian 2009-01-22  
你的图片真的 ;豪放。。。

相关推荐

Global site tag (gtag.js) - Google Analytics