Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument

前端 未结 2 858
灰色年华
灰色年华 2021-01-20 17:23

I just migrate to spring JPA technology and manage to change my simple jersey-hibernate project to spring JPA with custom crudrepository. But I can\'t deal with auto config

2条回答
  •  北恋
    北恋 (楼主)
    2021-01-20 18:03

    Exception says that there is no bean with name entityManagerFactory, Place a debug point in

    public LocalContainerEntityManagerFactoryBean entityManagerFactory(
                EntityManagerFactoryBuilder factoryBuilder)
    

    method org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration.class and check why the bean is not getting initiated.

    Oh, From discussion I came to the conclusion that mentioned issue is due to hibernate older dependencies. Also, the @Id which was imported needs to be from javax.persistence.id for all your entities.

提交回复
热议问题