当前位置:网站首页>Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
Error creating bean with name xxx Factory method ‘sqlSessionFactory‘ threw exception; nested excepti
2022-06-23 14:18:00 【抓手】
异常日志:
Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'xxx': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payRequestServiceImpl': Unsatisfied dependency expressed through field 'baseMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'payRequestMapper' defined in file [E:\code\xxx\xxx\target\classes\orm\mapper\XxxMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [com/baomidou/mybatisplus/autoconfigure/MybatisPlusAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.apache.ibatis.type.TypeException: The alias 'Entity' is already mapped to the value 'com.xxx.Entity'.
原因是MybatisPlus的typeAliasesPackage实体扫描包配置的范围太大了,导致spring容器启动时注入两个相同名称的Bean报错。
解决办法:
将.yml配置文件中的mybatis-plus.typeAliasesPackage的范围缩小,例如:mybatis-plus.typeAliasesPackage = com.**.**.po
其他方法,也可以将相同名称的Bean修改其中一个名字,这样启动就不报错了。不过这种方式治标不治本。
边栏推荐
- 等保备案是什么意思?应该去哪里办理备案?
- Is flush a stock? Is it safe to open an account online now?
- 2021-06-03
- 阿里 Seata 新版本终于解决了 TCC 模式的幂等、悬挂和空回滚问题
- 加快 yarn install 的三个简单技巧
- 2021-04-15
- 【二级等保】过二级等保用哪个堡垒机品牌好?
- Gold three silver four, busy job hopping? Don't be careless. Figure out these 12 details so that you won't be fooled~
- 大厂架构师:如何画一张大气的业务大图?
- 2021-06-07
猜你喜欢

The well-known face search engine provokes public anger: just one photo will strip you of your pants in a few seconds

KDD'22「阿里」推荐系统中的通用序列表征学习

Selenium Edge的IE模式

Error when Oracle enters sqlplus

How to solve the problem that iterative semi supervised training is difficult to implement in ASR training? RTC dev Meetup

【深入理解TcaplusDB技術】TcaplusDB構造數據

Effect evaluation of regression model under credit product quota pricing scenario

乐高宣布涨价,炒家更嗨皮了

Auto - vérification recommandée! Les bogues MySQL ne font pas reculer les transactions, peut - être êtes - vous à risque!

MySQL 创建和管理表
随机推荐
Logistics trade related
What do you mean by waiting for insurance records? Where should I go for filing?
基因检测,如何帮助患者对抗疾病?
General sequence representation learning in kdd'22 "Ali" recommendation system
Distributed database uses logical volume to manage storage expansion
Short talk about community: how to build a game community?
阿里 Seata 新版本终于解决了 TCC 模式的幂等、悬挂和空回滚问题
The data value reported by DTU cannot be filled into Tencent cloud database through Tencent cloud rule engine
Millions of bonuses are waiting for you to get. The first China Yuan universe innovation and application competition is in hot Recruitment!
Un million de bonus vous attend, le premier concours d'innovation et d'application de la Chine Yuan cosmique Joint Venture Black Horse Hot Recruitment!
The well-known face search engine provokes public anger: just one photo will strip you of your pants in a few seconds
SAP inventory gain / loss movement type 701 & 702 vs 711 & 712
2021-04-15
Quick view of wechat applet development process
Self inspection is recommended! The transaction caused by MySQL driver bug is not rolled back. Maybe you are facing this risk!
去 OPPO 面试, 被问麻了。。。
How to ensure long-term stable operation of EDI system
An idea plug-in for automatically generating unit tests
As a software testing practitioner, do you understand your development direction?
期货怎么开户安全吗,期货手续费哪家期货公司比较低,适合散户开户?