Spring Data JPA – Consider defining a bean named ‘entityManagerFactory’ in your configuration

In my case, I had the 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.

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)