일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- node-cron
- PS
- Kafka
- 25186
- ad-hoc
- eventLoop
- nextTick
- 1781
- 알고리즘
- macrotask
- 20309
- Java
- 코드리뷰를꼼꼼히하자
- 전역에러처리
- promise.race
- firebase functions
- 23289
- microtask
- 23560
- hash
- Bitwise AND
- 백준
- BOJ
- firebase functions deploy limit
- graceful shutdown
- node.js
- Docer
- 파라매틱서치
- 귀납적증명
- 25635
- Today
- Total
웰제오의 개발 블로그
EntityManagerFactoryBuilder could not be found 에러 원인과 해결 본문
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method entityManagerFactory in ... required a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.boot.orm.jpa.EntityManagerFactoryBuilder' in your configuration.
작업도중 위와 같은 에러를 만났다.
MultiDataSource 환경에서 AutoConfiguration 컨디션이 충족되지 못해 EntityManagerFactoryBuilder 빈이 생성되지 않은것이 원인 이었고
- DataSource 빈 중 하나에
@Primary
어노테이션을 추가 - EntityManagerFactoryBuilder 를 포함한 프로젝트에 필요한 빈들 수동 생성
둘 중 편한 방식으로 문제를 해결할 수 있다.
자세한 설명
EntityManagerFactoryBuilder 는 JpaBaseConfiguration
에서 AutoConfiguration 을 통해 생성 되는 빈 이다
Condition 으로는 ConditionalOnMissingBean
밖에 안보이는데... 이게 MultiDataSource 랑 무슨 상관이 있다는 걸까?
entityManagerFactoryBuilder 빈 생성 메소드가 의존하는 JpaVendorAdapter 를 봐도 이상한 점은 안보인다
JpaBaseConfiguration
을 다시 살펴보면, abstract class 임을 확인할 수 있는데,
해당 추상클래스의 구현체를 따라가 보면 HibernateJpaConfiguration
을 확인할 수 있다
위 사진에서 볼 수 있듯, 해당 configuration 의 컨디션은 ConditionalOnSingleCandidate
왜 MultiDataSource 환경에서 Primary 한 DataSource 가 없으면 EntityManagerFactoryBuilder 빈이 생성되지 않는지 확인할 수 있다
'개발' 카테고리의 다른 글
Node.js 환경에서의 Kafka Consumer Heartbeat 관련 트러블 슈팅 (2) | 2022.10.28 |
---|---|
[Node.js] Thread Hang 을 야기할 수 있는 작업의 핸들링 (Promise.race, Worker Thread) (1) | 2022.10.27 |
배포 프로세스 최적화를 통한 GCP functions deploy limit 해결 (0) | 2022.10.22 |
AWS ECS graceful shutdown 설정 및 트러블 슈팅 (1) | 2022.10.21 |
Node.js 환경에서의 반복작업 수행 (0) | 2022.10.19 |