首页 > 编程语言 >org.apache.shiro.session.InvalidSessionException: java.lang.I

org.apache.shiro.session.InvalidSessionException: java.lang.I

时间:2023-04-06 11:36:04浏览次数:43  
标签:lang web catalina java InvalidSessionException apache org ApplicationFilterChain

1.遇到以下异常,找了好长时间,终于解决,报的异常如下:

七月 07, 2017 3:02:16 下午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [SpringMVC] in context with path [/IMP] threw exception [org.apache.shiro.session.InvalidSessionException: 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.错误原因,从session通道获取不到属性值,存在两种原因,我的这个项目为webservice项目,需要调用另一个项目里面

的接口,第一个原因为,调用的项目接口实现的时候就没有获取到数据,或是没有调用成功

第二个原因为,数据库连接异常,没有数据

 

3.解决办法:重启项目,重新运行,然后就可以运行了



标签:lang,web,catalina,java,InvalidSessionException,apache,org,ApplicationFilterChain
From: https://blog.51cto.com/u_15535797/6172458

相关文章

  • java中如何创建带路径的文件
    请教各位大侠了,java中如何创建带路径的文件,说明下这个路径不存在------回答---------------其他回答(2分)---------JavacodeFilef=newFile("c:/1.txt");if(!f.exists()){try{f.createNewFile();}catch(IOExceptione){e.printStackTrace();}}------其他回答(18分)----......
  • java之常用正则表达式
    http://wenku.baidu.com/link?url=gLcsovVfQqRTVayxGGaWBpjyewi4qOopgEJ3JYWaPSm_VqIsX1ALI_ZJpnrMf51P2eFpWK03DbPQly7Hfs4yI1hqWJnHDSJBjfzKkrfLZKWhttps://msdn.microsoft.com/zh-cn/library/ae5bf541(VS.80).aspx......
  • java 生成不重复的随机数
    importjava.text.SimpleDateFormat;importjava.util.Date;publicclassTest2{ publicstaticvoidmain(String[]args){ SimpleDateFormatformatter2=newSimpleDateFormat("yyyy年MM月dd日HH:mm:ss"); SimpleDateFormatformatter=newSimpleDateF......
  • java中的NAN和INFINITY
      java中的NAN和INFINITY java浮点数运算中有两个特殊的情况:NAN、INFINITY。1、INFINITY:在浮点数运算时,有时我们会遇到除数为0的情况,那java是如何解决的呢?我们知道,在整型运算中,除数是不能为0的,否则直接运行异常。但是在浮点数运算中,引入了无限这个概念,我们来看一下Double和Float......
  • Android 12蓝牙报java.lang.SecurityException: Need android.permission.BLUETOOTH_C
    报错如下:E/AndroidRuntime:FATALEXCEPTION:mainProcess:com.studay.base.study,PID:16798java.lang.SecurityException:Needandroid.permission.BLUETOOTH_CONNECTpermissionforAttributionSource{uid=10392,packageName=com.studay.base.study,a......
  • Java中的Class类 小的总结
    *点击查看代码publicclassProjectConfig{//合作方产品唯一标示publicstaticStringSOURCEID="hthx_swyyssys_0001";//AES加密解密keypublicstaticfinalStringAESKEY="B62i45TKqs1qwJaD";//本地公钥publicstaticfinalString......
  • golang开发需要掌握的核心包以及中间件,涵盖项目的各个领域,值得收藏
    golang开发需要掌握的核心包以及中间件,涵盖项目的各个领域,值得收藏。常用包常用包 说明fmt 实现格式化的输入输出操作,其中的fmt.Printf()和fmt.Println()是开发者使用最为频繁的函数。io 实现了一系列非平台相关的IO相关接口和实现,比如提供了对os中系统相关的IO功能的封装。我们......
  • Javaweb简介
    JavawebWeb:全球广域网,也称万维网(www),能通过浏览访问的网站JavaWeb:是通过用Java技术来解决相关web护网领域的技术栈网页:展现数据(前端)数据库存储数据(DBA)JavaWeb程序:逻辑处理(后端)(MYSQL)数据库:存储数据的仓库,数据是有组织的进行存储......
  • Java SpringBoot Bean InitializingBean
    Spring中有两种类型的Bean,一种是普通Bean,另一种是工厂Bean,即FactoryBean。工厂Bean跟普通Bean不同,其返回的对象不是指定类的一个实例,其返回的是该工厂Bean的getObject方法所返回的对象。Spring初始化bean有两种方式:实现InitializingBean接口,实现afterPropertiesSet方法。(比通过......
  • Javascript中扁平化数据结构与JSON树形结构转换详解
    Javascript中扁平化数据结构与JSON树形结构转换详解原文链接:https://www.jb51.net/article/247525.htm+目录一.先说简单的树形结构数扁平化处理二.再讲将扁平化数据结构转JSON树状形结构扩充一个知识点:forin与forof的区别:总结不废话,直接开干一.先说简单的树形结构数......