一、该问题的重现步骤是什么?
业务结构如下
┃--comtroller
┃--service
┞ ----┕-----impl
┃--mapper
2.在impl 中 我方分别调用了 baseMapper 以及
手动注入了一个当前类的
@Autowired
private XxxxxMapper xxxxxMapper;
二、你期待的结果是什么?实际看到的又是什么?
是不是因为我们重复注入了所以导致了如下报错的问题
三、你正在使用的是什么产品,什么版本?在什么操作系统上?
四、请提供详细的错误堆栈信息,这很重要。
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2021-02-27 11:07:33.564 ERROR 1 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPLICATION FAILED TO START *************************** Description: Field baseMapper in com.baomidou.mybatisplus.extension.service.impl.ServiceImpl required a single bean, but 2 were found: - org.springblade.modules.xxxx.mapper.xxxxMapper: defined in null - algorithmInfoMapper: defined in URL [jar:file:/home/jar/xxx.jar! /BOOT-INF/classes!/org/springblade/modules/xxx/mapper/xxxxMapper.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
五、若有更多详细信息,请在下面提供。
-
bean实例化了两次,导致不知道注入哪一个,所以报错了
另外商业版答疑规则见:https://sns.bladex.cn/article-14990.html
请将账号邮箱修改为下单购买授权的qq邮箱便可咨询商业版疑问
讨论(0)
- 热议问题
-
物联网平台采集的数据做WebSocket 这种推送从哪里介入比较好
1
-
【组态】绑定设备,并设置过滤后,点击【请求数据】,结果是空。
1
-
新拉取的 blade-boot版本前端是那个
1
-
物联网平台有封装HTTP请求的工具类吗
1
-
大屏的列表组件怎么能获得点击某一项的数据库
1
-
项目启动报错,nacos为3.0.1版本。
1
-
物联网系统,设备动态注册,相同uniqueNo 注册多次 写入多次入库,缓存导致的问题
1
-
minio上传地址修改错误
1
-
Knife4j访问文档页面(http://localhost/doc.html)异常!
1
-
install了4.0.1的tool,依赖还是不存在
1
扫一扫访问 Blade技术社区 移动端