当前位置: 代码迷 >> 综合 >> DefaultSerializer requires a Serializable payload but received an object of type
  详细解决方案

DefaultSerializer requires a Serializable payload but received an object of type

热度:51   发布时间:2023-12-25 16:59:34.0

在使用SpringBoot自带的缓存注解@EnableCaching和@Cacheable时,报错DefaultSerializer requires a Serializable payload but received an object of type。要缓存的 Java 对象必须实现 Serializable 接口,因为 Spring 会将对象先序列化再存入 Redis,将缓存实体类继承 Serializable。

  相关解决方案