springboot整合redis,从redis中取数据时出现类型转换异常,
jackson2JsonRedisSerializer.setObjectMapper(objectMapper); redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setValueSerializer(jackson2JsonRedisSerializer); // redisTemplate.setValueSerializer(new FastJsonRedisSerializer<>(Object.class)); redisTemplate.setHashKeySerializer(new StringRedisSerializer()); redisTemplate.setHashValueSerializer(jackson2JsonRedisSerializer);
原文:https://www.cnblogs.com/menbo/p/14402376.html