5

本地环境可以 安全退出,部署到服务器上就会报错!

本地环境运行的时候可以安全退出,部署到服务器上就会报错。
菜鸟一枚, 求大神解答!!! 谢啦
HTTP Status 500 - getAttribute: Session already invalidate

type Exception report message getAttribute: Session already invalidated

description The server encountered an internal error that prevented it from fulfilling this request.

exception
java.lang.IllegalStateException: getAttribute: Session already invalidated
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.java:1189)
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessionFacade.java:120)
org.apache.struts2.dispatcher.SessionMap.get(SessionMap.java:163)
java.util.AbstractMap.equals(AbstractMap.java:460)
java.util.ArrayList.remove(ArrayList.java:510)
com.bgi.uims.module.sys.user.action.UserAction.logout(UserAction.java:218)
......

安全退出对应的action 代码如下:
//注销
@SuppressWarnings("rawtypes")
public String logout() {
if(!session.isEmpty())
{
// 注销掉Application中的
ServletContext application = request.getServletContext ();
List sessions = (ArrayList) application.getAttribute(Constant.SESSIONS);
if (sessions != null) {
sessions.remove(session);
}
String log = (String) session.get(Constant.LOGINLOG_ID);
if (log != null) {
SysLoginlog loginlog = new SysLoginlog();
loginlog.setLogId(log);
loginlog.setSysCode(ConfigConst.getSYSTEM_CODE());
loginlog.setSysLoginType("物流系统后台管理");
LoginAuthWsClient.getUIMSWebService(ConfigConst.getAUTH_ADDRESS()).loginLog(Constant.UPDATESTR, loginlog);
}
session.remove(Constant.DISABLEDRESOURCENAME);
session.remove(Constant.DISABLEDRESOURCEURL);
session.remove(Constant.LOGINLOG_ID);
session.remove(Constant.LOGINUSER);
session.remove(Constant.MENUS);

}
return SUCCESS;
}

查看全部
QUAN19940604
独执一叶
2015/09/10 02:28
  • session
  • 点赞
  • 收藏
  • 回答
    私信

2个回复