1 import com.fasterxml.jackson.annotation.JsonAutoDetect; 2 import com.fasterxml.jackson.annotation.PropertyAccessor; 3 import com.fasterxml.jackson.databind.DeserializationFeature; 4 import com.fasterxml.jackson.databind.ObjectMapper; 5 import com.fasterxml.jackson.databind.SerializationFeature; 6 import com.fasterxml.jackson.databind.jsontype.impl.LaissezFaireSubTypeValidator; 7 import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; 8 import io.lettuce.core.ClientOptions; 9 import io.lettuce.core.protocol.ProtocolVersion; 10 import org.springframework.boot.autoconfigure.data.redis.LettuceClientConfigurationBuilderCustomizer; 11 import org.springframework.context.annotation.Bean; 12 import org.springframework.context.annotation.Configuration; 13 import org.springframework.data.redis.connection.RedisConnectionFactory; 14 import org.springframework.data.redis.connection.lettuce.LettuceClientConfiguration; 15 import org.springframework.data.redis.core.RedisTemplate; 16 import org.springframework.data.redis.serializer.Jackson2JsonRedisSerializer; 17 import org.springframework.data.redis.serializer.StringRedisSerializer; 18 19 import java.time.LocalDateTime; 20 21 @Configuration 22 public class RedisConfig implements LettuceClientConfigurationBuilderCustomizer { 23 24 @Override 25 public void customize(LettuceClientConfiguration.LettuceClientConfigurationBuilder clientConfigurationBuilder) { 26 // manually specifying RESP2 27 clientConfigurationBuilder.clientOptions(ClientOptions.builder() 28 .protocolVersion(ProtocolVersion.RESP2) 29 .build()); 30 } 31 }
redis测试环境4,线上环境5,报错解决方案1
标签:core,jackson,caused,required,redis,springframework,org,import,com From: https://www.cnblogs.com/minglogs/p/17554348.html