[Solved] Redis Cache Error: org.springframework.data.redis.serializer.SerializationException: Could not read JSON..

Problem description


Using redis to cache data, it can be successfully saved to redis

The serialization format of the value used is: genericjackson2jsonredisserializer , but the error is obtained from the cache for the second time


Key error message, suggesting no constructor
org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Cannot construct instance of `io.renren.common.utils.PageUtils` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

Problem-solving:

The first method directly changes the serialization of value to string type. The second method adds an empty parameter structure

The second method is adopted. The disadvantage of the first method is that Chinese information may be escaped

Read More: