상세 컨텐츠

본문 제목

[JPA] No qualifying bean of type 'javax.persistence.EntityManagerFactory'

SPRING

by jeonghojin 2022. 11. 2. 16:01

본문

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.[2022-11-02 15:43:11][ERROR] Application run failedorg.springframework.beans.factory.BeanCreationException: Error creating bean with name 'IReutersConfigServiceImpl': Injection of persistence dependencies failed; nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type 'javax.persistence.EntityManagerFactory' available: expected single matching bean but found 2: biztalkEntityManager,metronomeEntityManager

 

EntityManager가 두 개가 충돌해서 발생한 것으로 추측


해결

 

 

빈 생성 부분과 인젝션 주입하는 부분에 name을 명시해주어야함.

 

관련글 더보기