问题描述
- tomcat运行时session错误
-
2013-6-14 9:42:32 org.apache.catalina.core.ContainerBase backgroundProcess 警告: Exception processing manager org.apache.catalina.session.StandardManager@1402d5a background process java.lang.NullPointerException at com.tiancom.pas.common.framework.context.SessionContainer.valueUnbound(SessionContainer.java:41) at org.apache.catalina.session.StandardSession.removeAttributeInternal(StandardSession.java:1654) at org.apache.catalina.session.StandardSession.expire(StandardSession.java:756) at org.apache.catalina.session.StandardSession.isValid(StandardSession.java:592) at org.apache.catalina.session.ManagerBase.processExpires(ManagerBase.java:680) at org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:665) at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1316) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590) at java.lang.Thread.run(Thread.java:619)
错误信息如上,个人猜测有可能与session登录超时有关,求指导。
解决方案
发现我这的代码中HttpSessionBindingListener的子类代码如下:
public void valueUnbound(HttpSessionBindingEvent event) {
System.out.println("User:"+loginUser.getUserName()+" Being unbound...");
this.setLoginUser( null ); //直接把loginuser对象赋值null
}
如果按帖子内容修改,如何修改?
时间: 2024-11-08 20:25:51