• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

timeTraceAop만들고 SpringApplication 실행하는데 걸린 시간이 안나오네요..

21.12.01 01:13 작성 조회수 540

0

결과창이 이렇게 뜨는데 아무리 고쳐봐도 안되네요..

***************************

APPLICATION FAILED TO START

***************************

 

Description:

 

The bean 'timeTraceAop', defined in class path resource [com/example/hellospring/Service/SpringConfig.class], could not be registered. A bean with that name has already been defined in file [C:\Users\zzang\Downloads\java\hello-spring\build\classes\java\main\com\example\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

답변 5

·

답변을 작성해보세요.

6

OMG님의 프로필

OMG

2021.12.01

안녕하세요. misticz0715님, 공식 서포터즈 OMG입니다.

 

에러메시지를 보면 TimeTraceAop가 @Component로 인해 빈으로 등록되어 있어서

SpringConfig.class에서의 TimeTraceAop @Bean의 수동 빈등록이 안된다고 하네요.

SpringConfig에서 @Bean TimeTraceAop 부분이 있다면 삭제해주세요.

(강의 4분45초 참고)


감사합니다.

0

title.jjk님의 프로필

title.jjk

2023.07.01

아 여기였구나 ㅋㅋㅋㅋㅋ어쩐지 왜 또등록하시나했네

0

감사합니다!

0

onsway님의 프로필

onsway

2021.12.23

빠르게 지우시고 @Component로 이용하신거였군요,,!
못봤네요ㅋㅋㅋ 감사합니다 :)

0

YM B님의 프로필

YM B

2021.12.01

저도 계속 같은 에러가...