mybatis-plus Bean already defined with the same name!

文章描述了一个开发中遇到的问题,即在同时使用MyBatis和MyBatis-Plus时,由于mapper接口名称冲突导致警告。作者指出问题并非由`@Mapper`注解引起,而是由于分页插件PageHelper的版本过旧。解决方法是将PageHelper的SpringBootstarter版本从1.2.12升级到1.3.0。
摘要由CSDN通过智能技术生成

错误如下:

2022-06-13 13:29:59.237 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘bssAttaDao’ and ‘com.sawl.plug.gcode.dao.BssAttaDao’ mapperInterface. Bean already defined with the same name!
2022-06-13 13:29:59.237 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘bssBusinessDao’ and ‘com.sawl.plug.gcode.dao.BssBusinessDao’ mapperInterface. Bean already defined with the same name!
2022-06-13 13:29:59.237 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘bssNtznDao’ and ‘com.sawl.plug.gcode.dao.BssNtznDao’ mapperInterface. Bean already defined with the same name!
2022-06-13 13:29:59.237 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘bssPersonDao’ and ‘com.sawl.plug.gcode.dao.BssPersonDao’ mapperInterface. Bean already defined with the same name!
2022-06-13 13:29:59.238 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘bssPersonSignDao’ and ‘com.sawl.plug.gcode.dao.BssPersonSignDao’ mapperInterface. Bean already defined with the same name!
2022-06-13 13:29:59.238 WARN 47262 — [ main] o.m.s.mapper.ClassPathMapperScanner : Skipping MapperFactoryBean with name ‘plAppPlusDao’ and ‘com.sawl.plug.gcode.dao.PlAppPlusDao’ mapperInterface. Bean already defined with the same name!

这个是因为同时使用了mybaitis和mybaitis plus导致的

而网上大部分都说是@Mapper导致的,根本就是瞎扯, 经过不断地尝试发现把分页插件升级下就行了

  <!--分页-->
  <dependency>
    <groupId>com.github.pagehelper</groupId>
    <artifactId>pagehelper-spring-boot-starter</artifactId>
    <!--<version>1.2.12</version>-->
    <!--这里升级为1.3.0即可-->
    <version>1.3.0</version>
  </dependency>
  <!--分页-->

点赞 -收藏 -关注
有问题在评论区或者私信我-收到会在第一时间回复
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

胡安民

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值