spring autowired aop circular dependency

后端 未结 4 404
萌比男神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:21

    I managed to fix a similar issue by adding @Qualifier together with @Autowire, for example:

    @Autowired
    @Qualifier("publisher")
    private Publisher publisher;
    

提交回复
热议问题