0
votes

I added the Java melody configuration in my spring boot application after I start the embedded tomcat server, I'm getting the following error:

APPLICATION FAILED TO START

Description:

There is a circular dependency between 5 beans in the application context:

  • activeOrderController (field private om.gov.moh.nehr.service.ActiveOrderService om.gov.moh.nehr.controller.ActiveOrderController.activeOrderService)
  • activeOrderServiceImpl (field public om.gov.moh.nehr.data.repository.ActiveDiagnosticOrderRepo om.gov.moh.nehr.service.impl.ActiveOrderServiceImpl.activeDiagnosticOrderRepo)
  • activeDiagnosticOrderRepo
  • (inner bean)#26d445e9
  • entityManagerFactory defined in class path resource [om/gov/moh/nehr/config/DataSourceConfiguration.class]
  • dataSource
1
Error is self-explanatory. Review carefully your Spring beans. If you won't be able to find a circular dependency, consider posting mentioned 5 beans code here.Mikhail Kholodkov
check the dependencies in these classes.Sagar Kharab
after adding the below class i got above error, otherwise its working fine for mesamsudeen zubair

1 Answers

0
votes

I suspect you are trying to @Autowire beans in a class where they are instantiated. Can you double check that if you have defied these as @Bean? The spring container cannot inject them in the autowired fields since they are created in the same class.

Remove the @Autowired fields and try using directly to start with.