Spring Data JPA - Consider defining a bean named 'entityManagerFactory' in your configuration

后端 未结 9 2237
一个人的身影
一个人的身影 2020-12-29 05:24

I am developing an application in Spring, using Tomcat, Mysql5, Java8... The problem is that I cannot deploy it, due to \"required bean \'entityManagerFactory\' not found\"

9条回答
  •  庸人自扰
    2020-12-29 05:47

    In my case, i had wrong dependency: spring-data-jpa. when i changed to spring-boot-starter-data-jpa, it solved the problem. i didn't have to add any annotation @Repository nor @EnableJpa etc.

提交回复
热议问题