启动springboot jpa 报错 required a bean named 'entityManagerFactory' that could not be found.

本文介绍了解决FieldlabelDaoincom.tensquare.base.Service.LabelSerivere中出现的'entityManagerFactory'未找到的问题。通过定义相应的bean并更新依赖配置,包括删除并重新下载特定的jar包来修复报错。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Field labelDao in com.tensquare.base.Service.LabelSerive required a bean named ‘entityManagerFactory’ that could not be found.

Action:

Consider defining a bean named ‘entityManagerFactory’ in your configuration.

点开maven会发现org.springframework.boot:spring-boot-starter-data-jpa:2.0.1.RELEASE 报红 点开发现org.hibernate:hibernate-core:5.2.16.Final 报红
在仓库里repository\org\hibernate\hibernate-core里删除用到的jar包 , 让maven重新下载

升级到springboot3.3.7后,启动报错2025-05-28T14:29:27.304+08:00 WARN 14584 --- [todo-integration-server] [ main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'matterEntityManagerFactory' defined in file [E:\workSpace\cnooc_platform\eadcloud-todo-integration-server\server\hd-todo-integration-server\build\resources\main\META-INF\spring\todo-integration-service.xml]: Cannot create inner bean 'org.springframework.data.jpa.support.MergingPersistenceUnitManager#5a205ee5' of type [org.springframework.data.jpa.support.MergingPersistenceUnitManager] while setting bean property 'persistenceUnitManager' 2025-05-28T14:29:27.349+08:00 WARN 14584 --- [todo-integration-server] [ main] c.t.c.loader.WebappClassLoaderBase : The web application [ROOT] appears to have started a thread named [Thread-7] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread: java.base@17.0.1/sun.net.dns.ResolverConfigurationImpl.notifyAddrChange0(Native Method) java.base@17.0.1/sun.net.dns.ResolverConfigurationImpl$AddressChangeListener.run(ResolverConfigurationImpl.java:176) 2025-05-28T14:29:27.446+08:00 ERROR 14584 --- [todo-integration-server] [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: A component required a bean named 'dataSource' that could not be found. Action: Consider defining a bean named 'dataSource' in your configuration.
最新发布
05-29
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值