Spring Boot - repository field required a bean named 'entityManagerFactory' that could not be found

后端 未结 5 2146
温柔的废话
温柔的废话 2020-12-06 16:18

I am in the process of developing a Spring Boot application and came across this error when starting the server. I am not sure if I am incorrectly defining any annotations o

5条回答
  •  情深已故
    2020-12-06 16:55

    spring-boot-starter-data-jpa will pull in all the hibernate dependencies you need. Using spring boot release 1.5.1, it will pull in hibernate-core:5.0.11 and hibernate-entitymanager:5.0.11. In addition to being unnecessary, your hibernate dependency versions are mismatched which is what I'm guessing is causing the error.

    Try removing these dependencies from your pom.xml.

    
        org.hibernate
        hibernate-core
        4.1.4.Final
    
    
        org.hibernate
        hibernate-entitymanager
        5.2.3.Final
    
    

提交回复
热议问题