记一次项目启动报错 Skipping MapperFactoryBean with name ‘system_SysConfigMapper’ and ‘com.unicloud.system.mapper.SysConfigMapper’ mapperInterface. Bean already defined with the same name!
WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysDeptMapper' and 'com.unicloud.system.mapper.SysDeptMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysDictDataMapper' and 'com.unicloud.system.mapper.SysDictDataMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysDictTypeMapper' and 'com.unicloud.system.mapper.SysDictTypeMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysLogininforMapper' and 'com.unicloud.system.mapper.SysLogininforMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysMenuMapper' and 'com.unicloud.system.mapper.SysMenuMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysNoticeMapper' and 'com.unicloud.system.mapper.SysNoticeMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysOperLogMapper' and 'com.unicloud.system.mapper.SysOperLogMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysPostMapper' and 'com.unicloud.system.mapper.SysPostMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain] WARN o.m.s.m.ClassPathMapperScanner - [warn,44] - Skipping MapperFactoryBean with name 'system_SysRoleDeptMapper' and 'com.unicloud.system.mapper.SysRoleDeptMapper' mapperInterface. Bean already defined with the same name!
09:40:19.127 [restartedMain]
报错很多,但对项目启动没有影响
提示Bean注入重复了,我们就先从注入Bean的地方查找原因
指向的是Mapper文件,我们索性直接全局搜 @MapperScan【全局搜ctrl shift+F 】
搜到两处
很明显重复扫描了,我们只需要注释一处,即可解决
注释之后重新启动,发现大部分不报错了,只有个别mapper文件还在报错,我们点进去看看!
发现!!!!
然后把@mapper文件注释了就好
问题解决