강의

멘토링

커뮤니티

Inflearn Community Q&A

hdh956326's profile image
hdh956326

asked

Spring for Beginners - Learn Spring Boot, Web MVC, and DB Access Technology with Code

AOP Application

Bean 충돌 문제

Written on

·

771

2

https://drive.google.com/file/d/1db6-1LvayqONFQz_7MAwFU8JT9lWQwJp/view?usp=sharing

 

TimeTraceAop에 @Component를 쓰지 않고 SpringConfig에다가 @Bean으로 넣고 테스트케이스를 돌렸는데 순환 참조 에러가 발생했습니다. 

 

The dependencies of some of the beans in the application context form a cycle:

   memberController defined in file [/Users/hwangdonghwan/Desktop/Study/hello-spring/out/production/classes/hello/hellospring/controller/MemberController.class]
      ↓
   memberService defined in class path resource [hello/hellospring/SpringConfig.class]
┌─────┐
|  timeTraceAop defined in class path resource [hello/hellospring/SpringConfig.class]
└─────┘

 

@Around("execution(* hello.hellospring..*(..))")



이 부분을


@Around("execution(* hello.hellospring.service..*(..))")



이렇게 바꾸면 제대로 실행이 되는데.. 왜 그런지 모르겠습니다..

MVCspring-bootjavaspring

Answer 1

0

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

아래 링크를 참고해주세요.

https://www.inflearn.com/questions/48156

감사합니다.

hdh956326's profile image
hdh956326

asked

Ask a question