web项目启动报错。mapper 有问题 5C
Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.komlin.modular.checkon.mapper.CheckOnMapper.BaseResultMap
    at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:782) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:754) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:536) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:207) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.ResultMapResolver.resolve(ResultMapResolver.java:47) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:284) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:251) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:243) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:116) ~[mybatis-3.2.8.jar:3.2.8]
    at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:92) ~[mybatis-3.2.8.jar:3.2.8]
    at org.mybatis.spring.SqlSessionFactoryBean.buildSqlSessionFactory(SqlSessionFactoryBean.java:464) ~[mybatis-spring-1.2.2.jar:1.2.2]
    at org.mybatis.spring.SqlSessionFactoryBean.afterPropertiesSet(SqlSessionFactoryBean.java:340) ~[mybatis-spring-1.2.2.jar:1.2.2]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1637) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1574) ~[spring-beans-4.2.5.RELEASE.jar:4.2.5.RELEASE]
    ... 57 more


6个回答

检查一下,是不是有重名的ID

看你CheckOnMapper文件中是不是定义了两个BaseResultMap

删除Mybatis.xml中的标签所有内容。因为如果user-mapper.xml与namespace的接口在同一路径下,就不需要在mybaits.xml中再进行配置了

很明显看英文提示:Result Maps collection already contains value for com.komlin.modular.checkon.mapper.CheckOnMapper.BaseResultMap
他说的就是你的这个Result Map里边已经包含了BaseResultMap这个配置,检查你的xml配置。

BaseResultMap 这个id已经存在一个了 你仔细看一下xml文件

Result Maps collection already contains value for com.komlin.modular.checkon.mapper.CheckOnMapper.BaseResultMap
他说的就是你的这个Result Map里边已经包含了BaseResultMap这个配置,检查你的xml配置。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!