Framework/Spring Boot

[Error] java.lang.IllegalStateException: Failed to load ApplicationContext

잔망루피 2022. 7. 12. 21:59
java.lang.IllegalStateException: Failed to load ApplicationContext

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: 'java.util.List org.springframework.data.redis.connection.RedisConnection.getConfig(java.lang.String)'

Caused by: java.lang.NoSuchMethodError: 'java.util.List org.springframework.data.redis.connection.RedisConnection.getConfig(java.lang.String)'

에러 로그

 

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.7.0'
implementation group: 'org.springframework.session', name: 'spring-session-data-redis', version: '1.3.5.RELEASE'

수정 전 'spring-boot-starter-data-redis', 'spring-session-data-redis'의 dependency

처음에 2.7.0할려고 했는데 취약점이 있다고 해서

 

 

✨ 해결

implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-redis', version: '2.7.0'
implementation group: 'org.springframework.session', name: 'spring-session-data-redis', version: '2.7.0'

결국 2.7.0으로 버전을 똑같이 맞춤.

아니면 둘다 버전을 낮추는 방법도 있다.

 

 

 

참고 👇

https://stackoverflow.com/questions/51992484/caused-by-java-lang-nosuchmethoderror-org-springframework-data-redis-connectio

 

Caused by: java.lang.NoSuchMethodError: org.springframework.data.redis.connection.RedisConnection.getConfig(Ljava/lang/String;)L

I get this error when I'm trying to run my eureka server using properties from config server and I add this: spring.redis.host=localhost spring.redis.port=6379 I have also redis server running in...

stackoverflow.com

 

https://mvnrepository.com/artifact/org.springframework.session/spring-session-data-redis/2.7.0

 

Maven Repository: org.springframework.session » spring-session-data-redis » 2.7.0

 

mvnrepository.com

 

 

 

 

반응형