redis序列化问题



以上是配置redis,对double类型做的序列化封装。运行时报错如下

Error creating bean with name 'doubleRedisTemplate' defined in class path resource [applicationContext.xml]: Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.lang.String' to required type 'org.springframework.data.redis.serializer.RedisSerializer' for property 'hashKeySerializer'; nested exception is java.lang.IllegalStateException: Cannot convert value of type 'java.lang.String' to required type 'org.springframework.data.redis.serializer.RedisSerializer' for property 'hashKeySerializer': no matching editors or conversion strategy found

 重新改写applicationContext.xml文件如下,就正常运行了。


        
        
            
        
        
            
        
        
            
        
        
            
        
    

 

你可能感兴趣的:(JAVA)