Version: Springboot 2.5.4 and 2.5.3 Class:org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration Description:
The class RedisConnectionConfiguration use setUserName() method.But ConnectionInfo missing the method setUserName().So it can't be init when i use redis.
Comment From: mdeinum
The ConnectionInfo
doesn't have a setUsername
method because it is set through the constructor and that isn't the class that is giving the error. The RedisStandAloneConfiguration
is the errornous one, but it does have a setUsername
method in the version used.
It looks like that you are using an incompatible version of Spring Data Redis with Spring Boot (or vice-versa).
Comment From: philwebb
I agree with @mdeinum's analysis. The setUsername
method was introduced in this commit in Spring Data Redis 2.4-RC1. You're probably using an outdated version. If possible, we recommend using Spring Boot's managed dependencies which will ensure compatibility.
Comment From: 1161853339
Thank for reply!