8
Spring数据jpa-未定义名为'entityManagerFactory'的bean。自动连接的依赖项注入失败
我正在使用spring数据jpa,hibernate,mysql,tomcat7,maven开发应用程序,并且创建错误。我试图弄清楚,但失败了。 错误是在设置构造函数参数时无法解析对bean'entityManagerFactory'的引用;没有定义名为'entityManagerFactory'的bean。自动连接的依赖项注入失败 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'initDbService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private org.wahid.cse.repository.RoleRepository org.wahid.cse.service.InitDbService.roleRepository; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'roleRepository': Cannot create inner bean '(inner bean)#c08f81' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested …