扯淡的bug--shiro

Exception in thread "taskExecutor-5" org.apache.shiro.session.InvalidSessionException: java.lang.IllegalStateException: getAttribute: Session already invalidated
        at org.apache.shiro.web.session.HttpServletSession.getAttribute(HttpServletSession.java:148)
        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 com.mg.background.common.utils.UserUtils.getPrincipal(UserUtils.java:121)
        at com.mg.background.common.utils.UserUtils.getUser(UserUtils.java:30)
        at com.mg.background.common.persistence.BaseDataEntity.preInsert(BaseDataEntity.java:20)
        at com.mg.background.friend.service.MatchService.matchUserInfoById(MatchService.java:99)
        at com.mg.background.friend.service.MatchService$$FastClassBySpringCGLIB$$d6c1ef20.invoke(<generated>)
        at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)
        at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:718)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)
        at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)
        at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)
        at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
        at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)
        at org.springframework.aop.interceptor.ExposeInvocationInterceptor.in

在进行Subject subject = SecurityUtils.getSubject(); 操作的时候报了上面这个错误
https://issues.apache.org/jira/browse/SHIRO-298 这是官方给出的解决方案.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值