第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

使用自定義shiro Session管理 用戶退出時(shí)出現(xiàn)StoppedSessionException 異常

//用戶退出
SecurityUtils.getSubject().logout();
/**
?*?自定義session?管理
?*?解決多次請(qǐng)求redis?session?問題
?*?@author?Administrator
?*
?*/
public?class?CustomSessionManager?extends?DefaultWebSessionManager{
@Override
protected?Session?retrieveSession(SessionKey?sessionKey)?throws?UnknownSessionException?{
System.out.println(">>>>>>進(jìn)入>>>>session>>>>>start");
Serializable?sessionId?=?getSessionId(sessionKey);
ServletRequest?request=null;
if(sessionId?==null?)?{
System.out.println(">>>>>>sessionId?is?null");
System.out.println(">>>>>>進(jìn)入>>>>session>>>>end");
return?null;
}
if(sessionKey?instanceof?WebSessionKey)?{
request?=?((WebSessionKey)?sessionKey).getServletRequest();
}
//先從request中獲取session?如果沒有
if(request?!=?null?&&?sessionId?!=?null)?{
Session?session?=?(Session)?request.getAttribute(sessionId.toString());
//返回不為null的session
if(session?!=?null?)?{
System.out.println(">>>>>>進(jìn)入>>>>session>>>>end1");
return?session;
}
}
//如果request?中沒有?session?則從redis中獲取并保存到request
Session?session?=?super.retrieveSession(sessionKey);
if(request?!=?null?&&?sessionId?!=?null?)?{
request.setAttribute(sessionId.toString(),?session);
}
System.out.println(">>>>>>進(jìn)入>>>>session>>>>end2");
return?session;
}
}

異常信息↓
六月?21,?2018?3:56:30?下午?org.apache.catalina.core.StandardWrapperValve?invoke
嚴(yán)重:?Servlet.service()?for?servlet?[DispatcherServlet]?in?context?with?path?[/shiro-spring]?threw?exception?[Request?processing?failed;?nested?exception?is?java.lang.IllegalStateException:?org.apache.shiro.session.StoppedSessionException:?Session?with?id?[77105aa0-5cf8-411a-9a4f-2f257674eb8e]?has?been?explicitly?stopped.??No?further?interaction?under?this?session?is?allowed.]?with?root?cause
org.apache.shiro.session.StoppedSessionException:?Session?with?id?[77105aa0-5cf8-411a-9a4f-2f257674eb8e]?has?been?explicitly?stopped.??No?further?interaction?under?this?session?is?allowed.
at?org.apache.shiro.session.mgt.SimpleSession.validate(SimpleSession.java:270)
at?org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doValidate(AbstractValidatingSessionManager.java:186)
at?org.apache.shiro.session.mgt.AbstractValidatingSessionManager.validate(AbstractValidatingSessionManager.java:143)
at?org.apache.shiro.session.mgt.AbstractValidatingSessionManager.doGetSession(AbstractValidatingSessionManager.java:120)
at?org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupSession(AbstractNativeSessionManager.java:148)
at?org.apache.shiro.session.mgt.AbstractNativeSessionManager.lookupRequiredSession(AbstractNativeSessionManager.java:152)
at?org.apache.shiro.session.mgt.AbstractNativeSessionManager.getAttribute(AbstractNativeSessionManager.java:249)

有大佬測(cè)試過(guò)怎么解決嗎????!?。?!

https://img1.sycdn.imooc.com//5b2b5d13000159bd18860873.jpg


正在回答

1 回答

兄弟,解決了嗎?

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

使用自定義shiro Session管理 用戶退出時(shí)出現(xiàn)StoppedSessionException 異常

我要回答 關(guān)注問題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)