본문 바로가기
Spring Boot/error

The called method's class hierarchy was loaded from the following locations

by 상국이 2022. 3. 26.
728x90
2022-03-26 18:11:26.326  INFO 17027 --- [           main] c.e.redissample.RedissampleApplication   : Starting RedissampleApplication using Java 1.8.0_282 on cheolju.ECM with PID 17027 (/Users/cheolju/IdeaProjects/springbootredis/redissample/target/classes started by cheolju in /Users/cheolju/IdeaProjects/springbootredis/redissample)
2022-03-26 18:11:26.328  INFO 17027 --- [           main] c.e.redissample.RedissampleApplication   : No active profile set, falling back to 1 default profile: "default"
2022-03-26 18:11:26.677  INFO 17027 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2022-03-26 18:11:26.679  INFO 17027 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data Redis repositories in DEFAULT mode.
2022-03-26 18:11:26.697  INFO 17027 --- [           main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 6 ms. Found 0 Redis repository interfaces.
2022-03-26 18:11:26.961  WARN 17027 --- [           main] s.c.a.AnnotationConfigApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'redisRunner': Unsatisfied dependency expressed through field 'redisTemplate'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'stringRedisTemplate' defined in class path resource [org/springframework/boot/autoconfigure/data/redis/RedisAutoConfiguration.class]: Unsatisfied dependency expressed through method 'stringRedisTemplate' 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/LettuceConnectionConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.data.redis.connection.lettuce.LettuceConnectionFactory]: Factory method 'redisConnectionFactory' threw exception; nested exception is java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisStandaloneConfiguration.setUsername(Ljava/lang/String;)V
2022-03-26 18:11:26.975  INFO 17027 --- [           main] ConditionEvaluationReportLoggingListener : 

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2022-03-26 18:11:26.991 ERROR 17027 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
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.getStandaloneConfig(RedisConnectionConfiguration.java:82)

The following method did not exist:

    org.springframework.data.redis.connection.RedisStandaloneConfiguration.setUsername(Ljava/lang/String;)V

The calling method's class, org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration, was loaded from the following location:

    jar:file:/Users/cheolju/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/2.6.5/spring-boot-autoconfigure-2.6.5.jar!/org/springframework/boot/autoconfigure/data/redis/RedisConnectionConfiguration.class

The called method's class, org.springframework.data.redis.connection.RedisStandaloneConfiguration, is available from the following locations:

    jar:file:/Users/cheolju/.m2/repository/org/springframework/data/spring-data-redis/2.2.0.RELEASE/spring-data-redis-2.2.0.RELEASE.jar!/org/springframework/data/redis/connection/RedisStandaloneConfiguration.class

The called method's class hierarchy was loaded from the following locations:

    org.springframework.data.redis.connection.RedisStandaloneConfiguration: file:/Users/cheolju/.m2/repository/org/springframework/data/spring-data-redis/2.2.0.RELEASE/spring-data-redis-2.2.0.RELEASE.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.boot.autoconfigure.data.redis.RedisConnectionConfiguration and org.springframework.data.redis.connection.RedisStandaloneConfiguration


Process finished with exit code 1

 

해당 dependency의 version이 잘못되었을 때 뜸 > version 수정해주면 해결! 

728x90

댓글