本文介绍了在使用Mybatis时遇到的'java.lang.IllegalArgumentException: Result Maps collection already contains value for...'异常,原因是Mapper.xml文件中存在相同方法ID。解决方法是删除XML映射文件中的重复方法定义,或者清理并重新生成逆向工程的文件。
摘要由CSDN通过智能技术生成
报错信息
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\apache-tomcat-8.5.54\webapps\ROOT\WEB-INF\classes\spring\spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource:'URL [jar:file:/E:/apache-tomcat-8.5.54/webapps/ROOT/WEB-INF/lib/manager-impl-1.0-SNAPSHOT.jar!/mybatis/UserMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.atcrowdfunding.manager.dao.UserMapper.BaseResultMap
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java