Cannot serialize; nested exception is org.springframework.core.serializer.

Cannot serialize; nested exception is org.springframework.core.serializer.support.SerializationFailedException: Failed to serialize object using DefaultSerializer; nested exception is java.lang.IllegalArgumentException: DefaultSerializer requires a Serializable payload but received an object of type [com.ccj.springboot10_cache.entity.Employee]

springboot整合redis时报错,查一下发现时对象不能序列化

解决办法:将对象实现 Serializable 接口,问题就可解决。

Cannot serialize; nested exception is org.springframework.core.serializer.

 

Cannot serialize; nested exception is org.springframework.core.serializer.