Framework/Spring Boot

[Error] org.springframework.beans.factory.UnsatisfiedDependencyException

잔망루피 2021. 7. 22. 21:47

스프링 버전이 낮아서 2.5.2로 바꿨더니 서버 실행하면 아래 에러가 뜨면서 중단됨..

 

org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactory' parameter 0;nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactoryBuilder' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Unsatisfied dependency expressed through method 'entityManagerFactoryBuilder' parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'jpaVendorAdapter' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.orm.jpa.JpaVendorAdapter]: Factory method 'jpaVendorAdapter' threw exception; nested exception is java.lang.NoClassDefFoundError: org/hibernate/jpa/HibernatePersistenceProvider
at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:800) ~[spring-beans-5.3.8.jar:5.3.8]

 

 

🍯 해결

 

1. build.gradle의 dependency에서 아래 내용을 지움

compile 'org.hibernate:hibernate-core:5.0.7.Final'

 

 

 

참고 👇

https://stackoverflow.com/questions/29609740/unsatisfieddependencyexception-error-creating-bean-with-name-entitymanagerfact

 

UnsatisfiedDependencyException: Error creating bean with name 'entityManagerFactory'

I have a database configuration class to connect my spring web service with the database. I'm using spring boot, to make it stand alone application. Here is my class @Configuration @

stackoverflow.com

 

반응형