// Implement the InitializingBean interface and override this method (execute this method after initializing the bean) @Override public void afterPropertiesSet()
Try to write only one InitializingBean interface in a project.
If you write more than one, there will be different priorities during initialization, and problems will occur if there is a mutual dependency.
Solution:
1. @DependOn annotation (this annotation can be used when a bean needs to be initialized after another bean is initialized)
2. Write all the logic into an InitializingBean