alexxiyang / shiro-redis

shiro only provide the support of ehcache and concurrentHashMap. Here is an implement of redis cache can be used by shiro. Hope it will help you!
MIT License
1.17k stars 446 forks source link

反序列化时,发生ClassNotFoundException #84

Closed gjhuai closed 5 years ago

gjhuai commented 5 years ago

当tomcat配置shared.loader时,将shiro-redis放入其中,应用代码放在WEB-INF/lib下,反序列化时,找不到了类。

            ByteArrayInputStream byteStream = new ByteArrayInputStream(bytes);
            ObjectInputStream objectInputStream = new ObjectInputStream(byteStream);
            result = objectInputStream.readObject();

建议参考spring-data-redis, 重载ObjectInputStream这个类的resolveClass方法,在多个classLoader中找类。