报错记录
报错详情
Error creating bean with name 'saleLeadsController': Unsatisfied dependency expressed through field 'saleLeadsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'saleLeadsService': Unsatisfied dependency expressed through field 'saleLeadsMapper'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'saleLeadsMapper' defined in file [E:\IdeaProjects\kindo-oms\server\target\classes\com\kindo\oms\mapper\SaleLeadsMapper.class]: Unsatisfied dependency expressed through bean property 'sqlSessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in class path resource [org/mybatis/spring/boot/autoconfigure/MybatisAutoConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.apache.ibatis.session.SqlSessionFactory]: Factory method 'sqlSessionFactory' threw exception; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\IdeaProjects\kindo-oms\server\target\classes\mapper\SaleLeadsMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. The XML location is 'file [E:\IdeaProjects\kindo-oms\server\target\classes\mapper\SaleLeadsMapper.xml]'. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.kindo.oms.mapper.SaleLeadsMapper.BaseResultMap
总结
1 mapper,service,controller层注解检查,
2 查看启动类mapper
@MapperScan(basePackages = “com.kindo.oms.mapper”)
3 代码生成器重复生成,不会覆盖原有的,会在xml里面往后面加一样的 <resultMap 》…,仔细检查xml
4 查错教程------Mybatis报错 Result Maps collection already contains value for 原因汇总
https://blog.csdn.net/flystarfly/article/details/106195858