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封装好的接口与实现类。启动成功

以上是我项目中处理办法。欢迎大家指正。如果谁知道根本原因可以留言

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐