所有service都报required a single bean, but 2 were found 问题
所有service都报required a single bean, but 2 were found 问题
这些service都只有一个实现接口
报错如下:
Error starting ApplicationContext. To display the auto-configuration report re-run your application with ‘debug’ enabled.
2020-10-10 15:03:14.127 ERROR [restartedMain] [o.s.b.diagnostics.LoggingFailureAnalysisReporter] -
APPLICATION FAILED TO START
Description:
Field messageService in com.sto.unify.app.jnv2.controller.biz.TaskCenter.TaskCenterController required a single bean, but 2 were found:
- taskMessageServiceImpl: defined in file [/Users/zgz/IdeaProjects/sto-app-face/sto-app-face-jn/sto-app-face-jn-service/target/classes/com/sto/unify/app/jnv2/service/core/task/impl/TaskMessageServiceImpl.class]
- taskMessageService: defined in file [/Users/zgz/IdeaProjects/sto-app-face/sto-app-face-jn/sto-app-face-jn-service/target/classes/com/sto/unify/app/jnv2/service/core/task/TaskMessageService.class]
Action:
Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed
出现的原因:
是我的mapperScan 扫描的时候扫描到了所有的包,而不是单独的mapper的包。所以才报了这个错误,修改成下面就可以了。
@MapperScan(basePackages = {“com.sto.unify.app.jnv2.mapper”})
所有service都报required a single bean, but 2 were found 问题相关推荐
- 代码Service方法都报 Parameter 0 of constructor in com.fan.xx required a single bean, but 2 were found原因分析
今天遇到一个问题,拉取同事的代码,发现编译不过,报错如下: *************************** APPLICATION FAILED TO START ************** ...
- springboot启动报错Field *Service in *.*.controller.*Controller required a single bean, but 2 were found:
文章目录 报错: 解决 报错: Description: Field userService in com.atmae.agriculture.controller.UserController re ...
- SpringBoot项目启动异常:Field settlementMissService in...Service required a single bean, but 2 were found:
SpringBoot项目启动报错如下: *************************** APPLICATION FAILED TO START ************************ ...
- springboot使用redisTemplate 报错:APP FAILED TO START Field template in required a single bean redis工具类
springboot使用redisTemplate 报错: template in com.j.ssm.tool.RedisUtil required a single bean, but 2 wer ...
- spring boot多数据库数据源启动报错“required a single bean, but 2 were found”的正确解决办法
报错 Parameter 0 of method jdbcTemplate in org.springframework.boot.autoconfigure.jdbc.JdbcTemplateCon ...
- Field baseService in com.bim.controller.BaseController required a single bean, but 2 were found:
代码报错 Field baseService in com.bim.controller.BaseController required a single bean, but 2 were found ...
- 升级Springboot版本异常:HateoasConfiguration required a single bean, but 3 were found
在项目从springboot1.x升级到2.2.1时 报错 *************************** APPLICATION FAILED TO START ************** ...
- Field baseMapper in com.xxx required a single bean,but 100 were found --------Mybatis-Plus
报错发生时间:项目启动时. 报错英文描述:Field baseMapper in com.xxx required a single bean,but 100 were found 报错信息中文描述: ...
- idea:Field baseMapper in com.yjxxt.crm.base.BaseService required a single bean, but X were found
问题描述: 发生环境:项目回滚后,重新运行遇到了新的报错信息: Field baseMapper in com.yjxxt.crm.base.BaseService required a single ...
最新文章
- java中字符串转化为Ascii码
- 如何将比Long类型更大数值字符串转化为整数
- 计算机系统的主存主要是由()构成的。【最全!最详细分析!】
- P4381 [IOI2008]Island
- 信息安全工程师笔记-网络安全主动防御技术与应用
- jsp的include两种使用方法
- android UI设计属性中英对照表(未修订)
- QComboBox列表项高度设置
- mysql语法错误文件_使用logstash同步MySQL的数据时,在jdbc查询sql文件时报sql语法错误,sql文件是navicat生成的...
- html2canvas 在手机app端的问题
- 柯洁放言力拼AlphaGo:我抱有必死的信念!(全部细节都在这里)
- 数据挖掘导论 第四章 重点习题解答
- DelayQueue 阻塞队列
- b-spline学习-系数计算及程序实践
- 2020身高体重标准表儿童_婴儿身高体重对照表2020
- [n年以前的诗] 怀念中XXXX年5月的泰山二首
- linux ip_tos,IP_TOS选项
- 精读《Prisma 的使用》
- ABAC相关标准在数据服务中的应用——XACML和NGAC的比较
- Codeforces Round #702 (Div. 3)A-G题解
热门文章
- Java 常用集合类学习
- C++无依赖库的websocket实现
- 李沐论文精读: ResNet 《Deep Residual Learning for Image Recognition》 by Kaiming He
- 远洋调查设备使用快讯—Sentinel,磁力仪绞车
- 你的核心竞争力是什么?
- Codeforces Round #774 (Div. 2) A-D
- 创龙Xilinx Zynq-7000系列SoC高性能处理器开发板的RTC座、SMA端子
- L1-016 查验身份证(15 分)[PTA][isdigit()函数][加权求和][字符与数值的转换]
- ET---通过注册登陆请求走一遍简单的消息传输
- 电子纸android平板,海信的新平板Q5 终于来了,它能颠覆电纸书吗?