zoukankan      html  css  js  c++  java
  • shiro使用redis作为缓存,出现要清除缓存时报错 java.lang.Exception: Failed to deserialize at org.crazycake.shiro.SerializeUtils.deserialize(SerializeUtils.java:41) ~[shiroredis2.4.2.1RELEASE.jar:na]

    shiro使用redis作为缓存,出现要清除缓存时报错

    java.lang.Exception: Failed to deserialize
    at org.crazycake.shiro.SerializeUtils.deserialize(SerializeUtils.java:41) ~[shiro-redis-2.4.2.1-RELEASE.jar:na]
    at org.crazycake.shiro.RedisSessionDAO.getActiveSessions(RedisSessionDAO.java:66) [shiro-redis-2.4.2.1-RELEASE.jar:na]

    因为使用的是

    <groupId>org.crazycake</groupId>
    <artifactId>shiro-redis</artifactId>
    <version>2.4.2.1-RELEASE</version>
    所以在获取所有的session中的key来反序列化时出现不能反序列化。

    看了了下源码

     然后各种问题搜索,定义问题的出错在哪,最后发现是使用的

    <groupId>org.crazycake</groupId>
    <artifactId>shiro-redis</artifactId>
    <version>2.4.2.1-RELEASE</version>

    版本有的漏洞,但是在2.4.6版本的已经修复了这个bug

    2.4.6 解决了序列化的问题,请升级至2.4.6。而且被序列化的对象必须实现 java.io.Serializable 接口

  • 相关阅读:
    提交暂存更改时报 is outside repository 解决办法
    vue 路由跳转传参
    Unexpected token u in JSON at position 0 解决
    解决element table错位的问题
    使用docker制作Mysql镜像
    Linux系统性能排查
    分盘挂载
    Shell中的变量
    Shell流程控制
    Shell条件判断
  • 原文地址:https://www.cnblogs.com/KmilyLee/p/10062825.html
Copyright © 2011-2022 走看看