Restore session after restart in JBoss

2019-07-13 03:11发布

Can I somehow restore the session on JBoss after restart? I want to use it on my development machine.

2条回答
【Aperson】
2楼-- · 2019-07-13 03:46

This is answered in the documentation:

Since JBoss-3.2.6RC1:

The default tomcat session manager will persist sessions. This can lead to problems when restarting jboss or redeploying a war if the session contains non-serializable data.

To disable session persistence, you create a WEB-INF/context.xml with a Manager element that sets the pathname to an empty value:

<Context>
   <Manager className="org.apache.catalina.session.StandardManager"
      pathname="" ></Manager>
</Context>

JBoss-3.2.5 and earlier do not read the WEB-INF/context.xml file.

JBoss 4.0.3 has this disabled by default. See /jboss-4.0.3/server/default/deploy/jbossweb-tomcat55.sar/context.xml

查看更多
Viruses.
3楼-- · 2019-07-13 03:51

All servlet containers will try to keep the session alive between server restarts. But all session objects must be serializable in order for this to work.

查看更多
登录 后发表回答