티스토리 뷰

[EntityManagerFactory 오류 가능성]

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Class org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider does not implement the requested interface jakarta.persistence.spi.PersistenceProvider
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773) ~[spring-beans-6.1.2.jar:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.1.2.jar:6.1.2]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521) ~[spring-beans-6.1.2.jar:6.1.2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.2.jar:6.1.2]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.2.jar:6.1.2]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.2.jar:6.1.2]

 

1) application-test.yml

hibernate diaclect 설정이 잘못되어서 발생하는 에러일 수도.

dialect를 삭제해보자

2) EntityManagerFactory 인스턴스 생성 오류

인스턴스가 생성되지 않거나, Autowired가 안되었을수도 있어서 이 부분을 판다

3) build.gradle 파일 수정

testImplementation에 hibernate 버전 설정이 잘못되었는지 확인

4) hibernate-core 버전을 변경 => (O)

Jakart 네임스페이스가 들어간 hibernate로 변경했더니 에러코드가 바꼈다.

 

https://url.kr/ebahtl

 

애플리케이션 실행 시 오류 발생으로 질문 드립니다. - 인프런

WARN 30752 --- [ restartedMain] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh att...

www.inflearn.com

 

 

 

 

 

 

 

 

 

 

 

 

댓글