I have this problem when using Redis

Caused by: org.springframework.data.redis.serializer.SerializationException: 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 [org.springframework.http.ResponseEntity]

I saw that you already had an issue on the same subject, I would like to know if there is any solution

Comment From: bclozel

Thanks for getting in touch, but it feels like this is a question that would be better suited to StackOverflow. As mentioned in the guidelines for contributing, we prefer to use GitHub issues only for bugs and enhancements. Feel free to update this issue with a link to the re-posted question (so that other people can find it) or add some more details if you feel this is a genuine bug.

In this case, it seems you're trying to cache in redis a ResponseEntity object, which is not marked as Serializable (and is not meant to). You could cache the object that you're about to serialize as a response body in that entity, and possibly use a different serialization strategy. In any case, StackOverflow will be more helpful here, given that you provide more context to your question there.

Comment From: juliocesarsantos1020

Thank you

Comment From: sagarkudu

Thanks for telling the actual reason....

Comment From: johnvan08

nice answer