springboot集成redis,使用@Cacheable导致java.lang.ClassCastException:异常

来源:互联网 发布:库里体测数据 编辑:程序博客网 时间:2024/06/18 14:12

如题:

在springboot集成redis,使用@Cacheable的时候,


第一次查询到数据,存到了redis中,

紧接着第二次查询的时候,从缓存里取数据,报错

java.lang.ClassCastException: com.whb.book.entity.Book cannot be cast to com.whb.book.entity.Book


后来得知 是因为热部署的依赖导致的。注释掉就好了。



阅读全文
0 0