Consider defining a bean named 'entityManagerFactory' in your configuration.

ITTeco 2018-01-29 04:42:34
SpringBoot配置多数据源后(mysql+postgresql),写好各自的配置类后,主数据源包下的service实现类下注入Dao失败,求答案,在线等!!!!!!


2018-01-29 16:26:42.715  INFO 14600 --- [           main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'primaryPersistenceUnit'
2018-01-29 16:26:42.871 WARN 14600 --- [ main] ationConfigEmbeddedWebApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'bioPersonSyncBizImpl': Unsatisfied dependency expressed through field 'memberBiz'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'FaceRecBizGroupImpl': Unsatisfied dependency expressed through field 'zkFaceRegistrationService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'ZKFaceRegistrationServiceImpl': Unsatisfied dependency expressed through field 'zkFaceRegistrationDao'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'ZKFaceRegistrationDao': Cannot create inner bean '(inner bean)#7e5e7753' of type [org.springframework.orm.jpa.SharedEntityManagerCreator] while setting bean property 'entityManager'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name '(inner bean)#7e5e7753': Cannot resolve reference to bean 'entityManagerFactory' while setting constructor argument; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' available
2018-01-29 16:26:42.871 INFO 14600 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'primaryPersistenceUnit'
2018-01-29 16:26:42.871 INFO 14600 --- [ main] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'bioPersistenceUnit'
2018-01-29 16:26:42.893 INFO 14600 --- [ main] o.apache.catalina.core.StandardService : Stopping service Tomcat
2018-01-29 16:26:42.899 WARN 14600 --- [ main] o.s.boot.SpringApplication : Error handling failed (Error creating bean with name 'applicationStartInit' defined in file [D:\Program Files\workspace\sfas-server\zks-base\target\classes\com\zkteco\sys\contain\init\ApplicationStartInit.class]: BeanPostProcessor before instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration': Initialization of bean failed; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'org.springframework.context.annotation.ConfigurationClassPostProcessor.importRegistry' available)
2018-01-29 16:26:42.961 ERROR 14600 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :

***************************
APPLICATION FAILED TO START
***************************

Description:

Field FaceRegistrationDao in com.zkteco.primary.service.impl.FaceRegistrationServiceImpl required a bean named 'entityManagerFactory' that could not be found.


Action:

Consider defining a bean named 'entityManagerFactory' in your configuration.

Disconnected from the target VM, address: '127.0.0.1:14503', transport: 'socket'

Process finished with exit code 1
...全文
7429 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
VessalasdXZ 2019-01-09
  • 打赏
  • 举报
回复
兄弟最后怎么解决的
verejava 2018-08-20
  • 打赏
  • 举报
回复
jac-jm 2018-08-18
  • 打赏
  • 举报
回复
https://blog.csdn.net/qq_27298687/article/details/77896609

50,523

社区成员

发帖
与我相关
我的任务
社区描述
Java相关技术讨论
javaspring bootspring cloud 技术论坛(原bbs)
社区管理员
  • Java相关社区
  • 小虚竹
  • 谙忆
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧