Here, is a detailed post on how spring dependencies on one another can be resolved using @DependsOn --> Controlling Bean Creation Order with @DependsOn Annotatio
@DependsOn