I\'m using java config with @ComponentScan
in order to initialize my beans
and @EnableAspectJAutoProxy(proxyTargetClass=true)
to use cglib proxies.
I have same issue and I solved this issue:
I identified which @Autowired
property is reason for circular dependency.
Eg:
@Autowired
private TestService testService;
(Tips to identified just try to comment and find out which property is reason to break the application)
Once identified just use @Lazy
on top of this @Autowired
variable.
Eg :
@Lazy
@Autowired
private TestService testService;
And Application worked smoothly.