A couple of weeks ago, I upgraded the version of Spring from to 1.4.x.RELEASE to 1.5.1.RELEASE.
Suddenly it has become a fight to start my Spring Boot service due this error:
"The dependencies of some of the beans in the application context form a cycle"
Same code, different version
It's quite funny, since on my local env (OSX) the same code is usually starting fine, but on Heroku is failing randomly on different deploys (looks like a different order on classpath Class resolution, due OS or due different JDK implementations)
I have even refactored the code to use field injection instead of constructor one everywhere without success.
Any suggestion? why this Spring version has suddenly started to produce these errors?
Thanks!
答案 0 :(得分:4)
找出哪些bean是从日志循环的原因,并在代码中为此bean使用@Autowired的@Lazy注释。对于大多数情况,这应该成功。