-
Notifications
You must be signed in to change notification settings - Fork 41.3k
Closed
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Error message
12:18:07.526 [main] WARN o.s.b.w.s.c.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redis' defined in class path resource [com/org/api/common/health/redis/RedisHealthCheckAutoConfiguration.class]: Unsatisfied dependency expressed through method 'redis' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'redisConnectionFactory' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/JedisConnectionConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.jedis.JedisConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoSuchMethodError: 'void org.springframework.data.redis.connection.RedisSentinelConfiguration.setUsername(java.lang.String)'
...
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration.getSentinelConfig(RedisConnectionConfiguration.java:85)
The following method did not exist:
'void org.springframework.data.redis.connection.RedisSentinelConfiguration.setUsername(java.lang.String)'
The method's class, org.springframework.data.redis.connection.RedisSentinelConfiguration, is available from the following locations:
jar:file:/Users/mymac/.m2/repository/org/springframework/data/spring-data-redis/2.2.4.RELEASE/spring-data-redis-2.2.4.RELEASE.jar!/org/springframework/data/redis/connection/RedisSentinelConfiguration.class
The class hierarchy was loaded from the following locations:
org.springframework.data.redis.connection.RedisSentinelConfiguration: file:/Users/mymac/.m2/repository/org/springframework/data/spring-data-redis/2.2.4.RELEASE/spring-data-redis-2.2.4.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of org.springframework.data.redis.connection.RedisSentinelConfiguration
My understanding is that there is no compatible version available of org.springframework.data.redis.connection.RedisSentinelConfiguration
because
#29661 added
Line 98 in 7dd8dfc
config.setUsername(this.properties.getUsername()); |
which calls RedisSentinelConfiguration.setUsername()
resulting in a NoSuchMethodError
seen above. setUsername
was added
in spring-projects/spring-data-redis#2218 which won't be released until 2.7.0
.
Versions:
spring-boot version: 2.5.13
spring-boot-autoconfigure version: 2.5.13
spring-redis-data version: 2.2.4.RELEASE
application.yaml
contains
spring:
redis:
sentinel:
master: mymaster
nodes: redis-sentinel:26379
Metadata
Metadata
Assignees
Labels
status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid