Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cyclic dependencies caused by the current code structure #14

Closed
Jzow opened this issue Aug 30, 2023 · 1 comment
Closed

Cyclic dependencies caused by the current code structure #14

Jzow opened this issue Aug 30, 2023 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@Jzow
Copy link
Member

Jzow commented Aug 30, 2023

Currently, spring.main.allow-circular-references=true has been added to the application.properties file. But it cannot ultimately effectively solve circular dependencies, and in the face of this problem, it should be addressed through different code levels

error log:

2023/08/30-16:20:28 ERROR [main] org.springframework.boot.diagnostics.LoggingFailureAnalysisReporter - 

***************************
APPLICATION FAILED TO START
***************************

Description:

The dependencies of some of the beans in the application context form a cycle:

   accountControlleraccountService
┌─────┐
|  logService
↑     ↓
|  userService
↑     ↓
|  orgaUserRelService
↑     ↓
|  organizationService
└─────┘


Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.


Process finished with exit code 1

Bugs that need to be addressed

@Jzow Jzow added the type: bug A general bug label Aug 30, 2023
@Jzow Jzow self-assigned this Aug 30, 2023
@Jzow
Copy link
Member Author

Jzow commented Sep 3, 2023

Fixed

@Jzow Jzow closed this as completed Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

1 participant