79301844

Date: 2024-12-22 22:45:13
Score: 0.5
Natty:
Report link

Answers are right. Sometimes such error happens, because circular bean dependencies exist. I found solution to listen to ContextRefreshedEvent, then all beans are initialized and I am able to execute a method on this event.

@EventListener(ContextRefreshedEvent.class)
public void method(ContextRefreshedEvent event) {
    executeAMethod();
}
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: ReMadWeb