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 接口,問題就可解決。

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章