Spring

[SpringBoot] SQS 의존성 에러

meetyou 2022. 12. 4. 23:43

SQS를 시작하기 위해서 첫번째로 SQS 의존성을 추가하였다.

 

build.gradle

implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.1.RELEASE'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-messaging', version: '2.2.3.RELEASE'

 

위와 같이 추가했더니,,!

실행 조차 안되는 에러가 발생했다!!

무슨 bean이 자꾸 존재하지 않는다고 에러를 계속 띄웠다.

***************************
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.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration$Registrar.registerBeanDefinitions(ContextRegionProviderAutoConfiguration.java:73)

The following method did not exist:

    'void org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils.registerRegionProvider(org.springframework.beans.factory.support.BeanDefinitionRegistry, boolean, java.lang.String)'

The calling method's class, org.springframework.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration$Registrar, was loaded from the following location:

    jar:file:/Users/jeonhyeonjin/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-aws-autoconfigure/2.2.1.RELEASE/3330f1e31f1dafb44b0cc267580b62607fbdc918/spring-cloud-aws-autoconfigure-2.2.1.RELEASE.jar!/org/springframework/cloud/aws/autoconfigure/context/ContextRegionProviderAutoConfiguration$Registrar.class

The called method's class, org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils, is available from the following locations:

    jar:file:/Users/jeonhyeonjin/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-aws-context/2.2.3.RELEASE/5d0c32e46918eb93c2c00be4adbb6643f87af7c9/spring-cloud-aws-context-2.2.3.RELEASE.jar!/org/springframework/cloud/aws/context/config/support/ContextConfigurationUtils.class

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

    org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils: file:/Users/jeonhyeonjin/.gradle/caches/modules-2/files-2.1/org.springframework.cloud/spring-cloud-aws-context/2.2.3.RELEASE/5d0c32e46918eb93c2c00be4adbb6643f87af7c9/spring-cloud-aws-context-2.2.3.RELEASE.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springframework.cloud.aws.autoconfigure.context.ContextRegionProviderAutoConfiguration$Registrar and org.springframework.cloud.aws.context.config.support.ContextConfigurationUtils

 

열심히 구글링 해 본 결과,,!

build.gradle에 다음과 같은 종속성을 넣어주면 해결된다고 한다!!!

implementation group: 'org.springframework.cloud', name: 'spring-cloud-starter-aws', version: '2.2.1.RELEASE'
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-messaging', version: '2.2.3.RELEASE'

// 반드시 추가!!!!
implementation group: 'org.springframework.cloud', name: 'spring-cloud-aws-autoconfigure', version: '2.2.3.RELEASE'

 

에러 없이 깔끔하게 스프링부트 스타트 성공~~~