当前位置: 移动技术网 > IT编程>开发语言>Java > mybatis报错:Caused by: java.lang.IllegalArgumentException: Caches collection already contains value for com.crm.dao.PaperUserMapper

mybatis报错:Caused by: java.lang.IllegalArgumentException: Caches collection already contains value for com.crm.dao.PaperUserMapper

2018年10月29日  | 移动技术网IT编程  | 我要评论

一、问题

    eclipse启动时报下面的错误:


caused by: java.lang.illegalargumentexception: caches collection already contains value for com.crm.dao.paperusermapper
    at org.apache.ibatis.session.configuration$strictmap.put(configuration.java:782) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.session.configuration$strictmap.put(configuration.java:754) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.session.configuration.addcache(configuration.java:516) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.builder.mapperbuilderassistant.usenewcache(mapperbuilderassistant.java:132) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.builder.xml.xmlmapperbuilder.cacheelement(xmlmapperbuilder.java:209) ~[mybatis-3.2.7.jar:3.2.7]
    at org.apache.ibatis.builder.xml.xmlmapperbuilder.configurationelement(xmlmapperbuilder.java:114) ~[mybatis-3.2.7.jar:3.2.7]
    ... 82 common frames omitted

qq截图20181029140841

二、解决

    a.检查命名空间、别名是否正确

    b.检查mapper.xml和mapper.java中是否有重复的

    我这里是因为项目mapper.xml中出现重复的,修改后问题成功解决。小建议:把insert、select这些标签折起来,然后看看id属性是不是有重复的。

三、参考文献

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网