Field baseMapper in com.baomidou.mybatisplus.extension.service.impl.ServiceImpl required a single be
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.2019-07-17 09:16:28.739 ERROR 9800 --- [main] o.s.b.d.LoggingFailureAnalysisReporter:**
·
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2019-07-17 09:16:28.739 ERROR 9800 --- [ 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 3 were found:
- miguBusiHisMapper: defined in file [D:\workspaceIdea\ywjc-refactor\target\classes\com\guoll\modules\miguProject\mapper\MiguBusiHisMapper.class]
- miguBusiInfoMapper: defined in file [D:\workspaceIdea\ywjc-refactor\target\classes\com\guoll\modules\miguProject\mapper\MiguBusiInfoMapper.class]
- sysUserMapper: defined in file [D:\workspaceIdea\ywjc-refactor\target\classes\com\guoll\modules\sysmanage\mapper\SysUserMapper.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
Process finished with exit code 1
springBoot 集成mybatis-plus 。系统启动报如上错误
项目介绍:mybatis-plus自己封装了 基础的servie、ServiceImpl及BaseMapper
我自己的项目中,又封装了一层基础的接口、实现类并且分别集成、实现mybatis-plus封装好的以上 基础类
项目中的接口、实现类继承和实现我自己的封装的基础类,间接继承与实现mybatis-plus封装好的基础类
产生的原因暂时不清楚,可能怀疑,我自己封装的基础接口、实现类,又集成mybatis-plus中的基础接口、实现类。写的方法存在问题造成的
解决办法:删除项目中自己封装的基础类,实体类直接集成mybatis-plus封装好的接口与实现类。启动成功
以上是我项目中处理办法。欢迎大家指正。如果谁知道根本原因可以留言
更多推荐
已为社区贡献1条内容
所有评论(0)