问题
Error creating bean with name 'sqlSessionFactory' defined in class path resource [tk/mybatis/mapper/autoconfigure/MapperAutoConfiguration.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 [D:\JavaP\foodie-dev\foodie-dev-mapper\target\classes\mapper\UsersMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML.
The XML location is 'file [D:\JavaP\foodie-dev\foodie-dev-mapper\target\classes\mapper\UsersMapper.xml]'.
Cause: java.lang.IllegalArgumentException: Result Maps collection
already contains value for com.imooc.mapper.UsersMapper.BaseResultMap
原因
该错误是因为一个xml文件出了问题
可能使使用逆向工程Generator的时候xml文件出了问题
解决
检查一下xml文件,删掉问题代码,即上图中我圈出来的就是问题代码,删掉就可以了