spring autowired aop circular dependency

后端 未结 4 406
萌比男神i
萌比男神i 2021-01-31 09:07

I\'m using java config with @ComponentScanin order to initialize my beans and @EnableAspectJAutoProxy(proxyTargetClass=true)to use cglib proxies.

4条回答
  •  南方客
    南方客 (楼主)
    2021-01-31 09:13

    Finally I sorted it out using @Lazyon services (with methods annotated with @Async), and also, where they were autowired. This way I guess Spring only initialize and autowires those services when they're required instead of on application context initialization.

提交回复
热议问题