Description
Due to legacy code, we’ve enabled circular dependencies. With the same codebase, both my colleague and I can run it normally on macOS, but on our server (Amazon Linux), we’re encountering circular dependency issues (Spring Boot 3.1.4). It’s been driving us crazy—we’ve run into this kind of problem at least three times. Our workaround has always been replacing constructor injection with @Autowired
. What’s even more frustrating is that we haven’t been able to build a minimal reproducible case…
I did some research and found that many others have faced the same issue:
https://stackoverflow.com/questions/29347723/why-does-spring-get-circular-dependency-issues-on-one-machine-and-not-another
I think this perspective might be accurate:
https://stackoverflow.com/a/34206071/24228439
However, I haven’t found any related issues in the Spring Boot issue tracker. I’d really like to know if anyone else has encountered something similar, and what solutions worked for them.