<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div><span style="background-color: rgba(255, 255, 255, 0);">いつもお世話になっております。<br>山﨑と申します。<br><br>2点ご報告させていただきたくご連絡いたしました。<br><br>HttpSessionがinvalidatedの状態で、MayaaSerlvletにフォワードすると<br>サーブレット内でIllegalStateExceptionが発生しました。<br><br>スタックトレースを確認したところ、<br>SessionScopeImpl#hasAttributeの_httpSession.getAttributeNamesの先で発生しておりました。<br><br>SessionScopeImplのソースを確認したところ、Session already invalidatedの場合の対応として、<br>SessionScopeImpl#checkで_httpSession.getId()を呼び出し、<br>IllegalArgumentExceptionをキャッチして_httpSessionをnullにする処理が入っているかと思いますが、<br>そこで2点確認させてください。<br><br>1.<br>キャッチする例外はIllegalArgumentExceptionではなく、IllegalStateExceptionが正しい?<br><br>2.<br>_httpSession.getId()ではなく、isNew()やgetLastAccessedTime()のほうが良い?<br>→<br>現在、実行環境としてJboss EAP 6.4を使っているのですが、<br>invalidatedのときでもgetId()では、IllegalStateExceptionが発生いたしません。<br>(getAttributeNamesでは発生します。)<br><br>OracleのjavaEEのJavadocを確認したところ、HttpSession#getIdでは、<br>HttpSessionがinvalidatedの状態でIllegalStateExceptionが発生するという規定はなく<br>isNewやgetAttributeNamesではIllegalStateExceptionが発生するという規定がありました。<br>ただ、Tomcatのservletapiの仕様ではHttpSession#getIdでIllegalStateExceptionが発生するという規定がありました。<br><br>私のほうでは、本件を回避する対策として、<br>SessionScopeImplを継承するクラスを作成して、isNew()を呼ぶようにしております。<br><br>利用バージョンはmayaaのgithubのmasterブランチの最新(Commits on Apr 13, 2014)をクローンしたものを使っています。<br><br>参考URL<br><<a dir="ltr" href="http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSession.html" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="2">http://docs.oracle.com/javaee/6/api/javax/servlet/http/HttpSession.html</a>><br><<a dir="ltr" href="https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html" x-apple-data-detectors="true" x-apple-data-detectors-type="link" x-apple-data-detectors-result="3">https://tomcat.apache.org/tomcat-5.5-doc/servletapi/javax/servlet/http/HttpSession.html</a>></span></div></body></html>