使用mybatis-plus遇到的坑:conflicts with existing, non-compatible bean definition of same name and class
在common模块中配置mybatis-plus的分页插件,
官方文档配置中加了mapperScan注解,在其他模块引入common包时在主启动类上加了componentScan注解来引入common模块下的各种东西。
启动时报错**Annotation-specified bean name ‘attrService’ for bean class [xxx.xxxService] conflicts with existing, non-compatible bean definition of same name and class [xxx.xxxrServiceImpl] **。估计是componentScan 和mapperScan重复扫描了组件。
在实现类上面@service注解中指定了接口名
然后我把@service括号的类容删除,就不会报这个错误,但是不知道为什么所有写的接口都失效了,报了这个错Invalid bound statement (not found)。
最后把mybatis-plus的分页插件上的mapperScan注解去掉就好了。