legacy-knowledge-base
公開されました Jul. 2, 2025

javax.portlet.PortletException: java.lang.IllegalStateException: getAttribute:セッションは既に無効化されています エラー

written-by

Thanga Meena

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

問題

  • なぜこのようなエラーが発生するのでしょうか? 原因は何でしょう?
INFO  [http-nio-8080-exec-2573][CustomLoginPortlet:726] url redirect = https://xxxx/group/yyyy
ERROR [http-nio-8080-exec-2573][PortletServlet:112] javax.portlet.PortletException: java.lang.IllegalStateException: getAttribute: Session already invalidated
javax.portlet.PortletException: java.lang.IllegalStateException: getAttribute: Session already invalidated
at com.liferay.portal.kernel.portlet.LiferayPortlet.callActionMethod(LiferayPortlet.java:205)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.callActionMethod(MVCPortlet.java:415)
at com.liferay.portal.kernel.portlet.LiferayPortlet.processAction(LiferayPortlet.java:97)
at com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet.processAction(MVCPortlet.java:260)
at com.liferay.portlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:77)
at com.liferay.portal.kernel.portlet.PortletFilterUtil.doFilter(PortletFilterUtil.java:50)
at com.liferay.portal.kernel.servlet.PortletServlet.service(PortletServlet.java:108)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)

Environment

  • Liferay DXP 7.1

解決策

  • すでにセッションが無効化されていることを示します。 無効なセッションに関するスタックトレースは、通常、HttpSessionを無効にする何らかのコードが存在する可能性があることを示します。 セッションは呼び出しの一部で使用されていましたが、一部のコードがHttpSessionにアクセスし、無効化することができたため、失敗してしまいました。
  • デフォルトでは、ユーザーがLiferayプラットフォームにログインするたびに、生成されたJSESSIONIDが変わる可能性があります。セキュリティ対策として、プラットフォームは以前のセッションを無効にしようとするからです。 Liferay プラットフォームでは、デフォルトで session.enable.phishing.protection portal プロパティが有効になっており、値true を持ちます。
  • もう一つ考えられる理由については、こちらの記事で紹介しています。 詳しくは、こちらをご覧ください。

追加情報

did-this-article-resolve-your-issue

legacy-knowledge-base