2006-11-03
Tomcat 5的Session Persistent问题
关键字: Tomcat,Session Persistent
碰到这样一个问题:
J2ee的session并没有要求session attribute必须要Serializable呀。原来这是tomcat 5的新功能,服务复位后自动恢复session。
如果要禁用这一特性,到apache-tomcat/conf/Catalina/localhost目录下找到webapp同名的xml,修改成:
对于使用Netbeans自带tomcat的情况,配置文件在用户Home目录下的.netbeans底下,例如我windows机器上是:
C:\Documents and Settings\pinxue\.netbeans\5.5beta\apache-tomcat-5.5.16_base\conf\Catalina\localhost\
如果想保留这个功能,但是清除异常的session持久记录,删除相应的SESSION.ser即可,该文件在:
.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\{webAppName}\SESSIONS.ser
补充:
Netbeans 重新发布 webapp 后,对应的context会重新生成,应该修改项目下META-INF/context.xml。
Netbeans生成该文件的模板是:
\Program Files\netbeans-5.5beta\enterprise3\apache-tomcat-5.5.16\conf\context.xml
引用
2006-7-26 20:49:41 org.apache.catalina.session.StandardManager start
严重: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: ...
严重: Exception loading sessions from persistent storage
java.io.WriteAbortedException: writing aborted; java.io.NotSerializableException: ...
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>
<Manager className="org.apache.catalina.session.PersistentManager" saveOnRestart="false"/>
</Context>
对于使用Netbeans自带tomcat的情况,配置文件在用户Home目录下的.netbeans底下,例如我windows机器上是:
C:\Documents and Settings\pinxue\.netbeans\5.5beta\apache-tomcat-5.5.16_base\conf\Catalina\localhost\
如果想保留这个功能,但是清除异常的session持久记录,删除相应的SESSION.ser即可,该文件在:
.netbeans\5.5beta\apache-tomcat-5.5.16_base\work\Catalina\localhost\{webAppName}\SESSIONS.ser
补充:
Netbeans 重新发布 webapp 后,对应的context会重新生成,应该修改项目下META-INF/context.xml。
Netbeans生成该文件的模板是:
\Program Files\netbeans-5.5beta\enterprise3\apache-tomcat-5.5.16\conf\context.xml
发表评论
- 浏览: 63845 次
- 性别:

- 来自: 深圳

- 详细资料
搜索本博客
我的相册
111
共 1 张
共 1 张
最近加入圈子
最新评论
-
Ubuntu Mobile Edition: ...
是疯狂,不知道什么时候能那个用一用~
-- by nishizhen -
使用XMPP4R在RubyOnRails ...
基本上都是可以的,只是不同的语言对其协议的封装实现不一样而已。原理都是差不多的。 ...
-- by iceskysl -
使用XMPP4R在RubyOnRails ...
想问一下,如果不是ror开发的网站,可以用你说的方法设计机器人吗?如果可以的话, ...
-- by sea gull -
请教一个奇怪的问题:java ...
各位帮忙分析下 :)多谢~
-- by iceskysl -
Rails4Days(ChineseVersio ...
iceskysl 写道phoenixup 写道链接地址已经失效了,如果方便请ma ...
-- by phoenixup






评论排行榜