Org.apache.shiro.session.InvalidSessionException:java.lang.IllegalStateException:getAttribute:Session already Invalidated] with root cause

Source: Internet
Author: User

1. Encountered the following exception, looked for a long time, finally resolved, reported the exception as follows:

July 07, 2017 3:02:16 pm Org.apache.catalina.core.StandardWrapperValve invoke
Critical: Servlet.service () for Servlets [SPRINGMVC] in context with path [/imp] threw exception [Org.apache.shiro.session.Invali DSessionException:java.lang.IllegalStateException:getAttribute:Session already invalidated] with root cause
Java.lang.IllegalStateException:getAttribute:Session already invalidated
At Org.apache.catalina.session.StandardSession.getAttribute (standardsession.java:1190)
At Org.apache.catalina.session.StandardSessionFacade.getAttribute (standardsessionfacade.java:103)
At Org.apache.shiro.web.session.HttpServletSession.getAttribute (httpservletsession.java:146)
At Org.apache.shiro.session.ProxiedSession.getAttribute (proxiedsession.java:121)
At Org.apache.shiro.subject.support.DelegatingSubject.getRunAsPrincipalsStack (delegatingsubject.java:469)
At Org.apache.shiro.subject.support.DelegatingSubject.getPrincipals (delegatingsubject.java:153)
At Org.apache.shiro.subject.support.DelegatingSubject.getPrincipal (delegatingsubject.java:149)
At Org.apache.shiro.web.servlet.ShiroHttpServletRequest.getSubjectPrincipal (shirohttpservletrequest.java:95)
At Org.apache.shiro.web.servlet.ShiroHttpServletRequest.getUserPrincipal (shirohttpservletrequest.java:111)
At Org.springframework.web.servlet.FrameworkServlet.getUsernameForRequest (frameworkservlet.java:1079)
At Org.springframework.web.servlet.FrameworkServlet.publishRequestHandledEvent (frameworkservlet.java:1065)
At Org.springframework.web.servlet.FrameworkServlet.processRequest (frameworkservlet.java:996)
At Org.springframework.web.servlet.FrameworkServlet.doGet (frameworkservlet.java:852)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:622)
At Org.springframework.web.servlet.FrameworkServlet.service (frameworkservlet.java:837)
At Javax.servlet.http.HttpServlet.service (httpservlet.java:729)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:292)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal (hiddenhttpmethodfilter.java:77)
At Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperrequestfilter.java:108)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:240)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter (proxiedfilterchain.java:61)
At Org.apache.shiro.web.servlet.AdviceFilter.executeChain (advicefilter.java:108)
At Org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal (advicefilter.java:137)
At Org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter (onceperrequestfilter.java:125)
At Org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter (proxiedfilterchain.java:66)
At Org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain (abstractshirofilter.java:449)
At Org.apache.shiro.web.servlet.abstractshirofilter$1.call (abstractshirofilter.java:365)
At Org.apache.shiro.subject.support.SubjectCallable.doCall (subjectcallable.java:90)
At Org.apache.shiro.subject.support.SubjectCallable.call (subjectcallable.java:83)
At Org.apache.shiro.subject.support.DelegatingSubject.execute (delegatingsubject.java:383)
At Org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal (abstractshirofilter.java:362)
At Org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter (onceperrequestfilter.java:125)
At Org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate (delegatingfilterproxy.java:344)
At Org.springframework.web.filter.DelegatingFilterProxy.doFilter (delegatingfilterproxy.java:261)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:240)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal (characterencodingfilter.java:88)
At Org.springframework.web.filter.OncePerRequestFilter.doFilter (onceperrequestfilter.java:108)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:240)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Org.apache.tomcat.websocket.server.WsFilter.doFilter (wsfilter.java:52)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:240)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Com.allcam.system.filter.SystemFilter.doFilter (systemfilter.java:87)
At Org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (applicationfilterchain.java:240)
At Org.apache.catalina.core.ApplicationFilterChain.doFilter (applicationfilterchain.java:207)
At Org.apache.catalina.core.StandardWrapperValve.invoke (standardwrappervalve.java:212)
At Org.apache.catalina.core.StandardContextValve.invoke (standardcontextvalve.java:106)
At Org.apache.catalina.authenticator.AuthenticatorBase.invoke (authenticatorbase.java:502)
At Org.apache.catalina.core.StandardHostValve.invoke (standardhostvalve.java:141)
At Org.apache.catalina.valves.ErrorReportValve.invoke (errorreportvalve.java:79)
At Org.apache.catalina.valves.AbstractAccessLogValve.invoke (abstractaccesslogvalve.java:616)
At Org.apache.catalina.core.StandardEngineValve.invoke (standardenginevalve.java:88)
At Org.apache.catalina.connector.CoyoteAdapter.service (coyoteadapter.java:522)
At Org.apache.coyote.http11.AbstractHttp11Processor.process (abstracthttp11processor.java:1095)
At Org.apache.coyote.abstractprotocol$abstractconnectionhandler.process (abstractprotocol.java:672)
At Org.apache.tomcat.util.net.nioendpoint$socketprocessor.dorun (nioendpoint.java:1500)
At Org.apache.tomcat.util.net.nioendpoint$socketprocessor.run (nioendpoint.java:1456)
At Java.util.concurrent.ThreadPoolExecutor.runWorker (threadpoolexecutor.java:1142)
At Java.util.concurrent.threadpoolexecutor$worker.run (threadpoolexecutor.java:617)
At Org.apache.tomcat.util.threads.taskthread$wrappingrunnable.run (taskthread.java:61)
At Java.lang.Thread.run (thread.java:745)


2. Error reason, from the session channel can not get the property value, there are two reasons, my project for the WebService project, need to call another project inside

Interface, the first reason is that when the project interface implementation is called, no data is obtained, or the call succeeds

The second reason, because the database connection is abnormal, no data

3. Workaround: Restart the project, run it again, and then you can run the

Org.apache.shiro.session.InvalidSessionException:java.lang.IllegalStateException:getAttribute:Session already Invalidated] with root cause

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.