코딩하는 쨈이

[Spring - 오류해결] Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true 본문

쨈,ErrorLog

[Spring - 오류해결] Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true

정쨈 2020. 12. 31. 18:11

[오류내용]

 

***************************
APPLICATION FAILED TO START
***************************

Description: The bean 'timeTraceAop', defined in class path resource [hello/hellospring/SpringConfig.class], could not be registered. A bean with that name has already been defined in file [/Users/chloe/Study/Spring/hello-spring/out/production/classes/hello/hellospring/aop/TimeTraceAop.class] and overriding is disabled.

Action: Consider renaming one of the beans or enabling overriding by setting spring.main.allow-bean-definition-overriding=true
Process finished with exit code 1

 

 

[오류해결]

스프링 2.1 버전부터는 overriding의 default 값이 false로 나와서 생기는 오류라고한다.

해결 방법은 application.properties에 Action에 나와있는 'spring.main.allow-bean-definition-overriding=true'를 넣어주면 된다.