79627332

Date: 2025-05-18 10:01:25
Score: 1
Natty:
Report link

It happens when JSON data couldn't deserialize properly, probably its about ObjectMapper configuration or @Cacheable useage.

Make sure you are using right serializer of RedisTemplate & doing the right ObjectMapper configuration

Like this:

@Bean
public RedisTemplate<String, Object> redisTemplate(RedisConnectionFactory connectionFactory) {
    RedisTemplate<String, Object> template = new RedisTemplate<>();
    template.setConnectionFactory(connectionFactory);
    template.setDefaultSerializer(new GenericJackson2JsonRedisSerializer());
    return template;
}
Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @Cacheable
  • Low reputation (1):
Posted by: Abdurrahman