Result Maps collection already contains value for com.liuyanzhao.ssm.mapper.Items的原因及解决办法

avatar 2017年08月17日13:35:39 1 4388 views
博主分享免费Java教学视频,B站账号:Java刘哥 ,长期提供技术问题解决、项目定制:本站商品点此
Caused by: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.mapper.PetMapper.BaseResultMap
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.java:97)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.parse(XMLMapperBuilder.java:73)
 at org.apache.ibatis.builder.xml.XMLConfigBuilder.mapperElement(XMLConfigBuilder.java:255)
 at org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:83)
 ... 5 more
Caused by: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.mapper.PetMapper.BaseResultMap
 at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:578)
 at org.apache.ibatis.session.Configuration$StrictMap.put(Configuration.java:551)
 at org.apache.ibatis.session.Configuration.addResultMap(Configuration.java:356)
 at org.apache.ibatis.builder.MapperBuilderAssistant.addResultMap(MapperBuilderAssistant.java:138)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:231)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElement(XMLMapperBuilder.java:201)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.resultMapElements(XMLMapperBuilder.java:196)
 at org.apache.ibatis.builder.xml.XMLMapperBuilder.configurationElement(XMLMapperBuilder.Java:93)

原因是在使用 mybatis 逆向工程生成代码的时候多次重复生成,导致配置配件多次重复积累,解决办法是把逆向工程里面的代码删除掉,然后再点击运行一次,刷新看到代码即可,然后再拷到新工程里面,这样在运行 web 项目就 ok 了
本文链接:https://liuyanzhao.com/5938.html
  • 微信
  • 交流学习,资料分享
  • weinxin
  • 个人淘宝
  • 店铺名:言曌博客咨询部

  • (部分商品未及时上架淘宝)

发表评论

avatar 登录者:匿名
匿名评论,评论回复后会有邮件通知

  

已通过评论:0   待审核评论数:0