Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already

前端之家收集整理的这篇文章主要介绍了Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

错误信息:

Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for org.hc.jiankunking.system.member.dao.OrderLogMapper.BaseResultMap; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\16年文件\JAVAdemo\jiankunking\jiankunking-web\target\jiankunking-web-1.0-SNAPSHOT\WEB-INF\classes\spring\spring-mybatis.xml]: Invocation of init method Failed; nested exception is org.springframework.core.NestedioException: Failed to parse mapping resource: 'URL [jar:file:/E:/16年文件/JAVAdemo/jiankunking/jiankunking-web/target/jiankunking-web-1.0-SNAPSHOT/WEB-INF/lib/jiankunking-system-1.0-SNAPSHOT.jar!/mapper/OrderLogMapper.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for org.hc.jiankunking.system.member.dao.OrderLogMapper.BaseResultMap 

分析:

错误提示信息中可以看出,应该是OrderLogMapper.xml文件有重复,mybatis识别不出来应该使用哪一个。

先在源码中看一下,发现没有重复;然后到错误提示信息中指明的:target/jiankunking-web-1.0-SNAPSHOT/WEB-INF/lib/jiankunking-system-1.0-SNAPSHOT.jar文件夹下搜索一下,结果发现:


OrderLogMapper.xml真的有重复。

解决

最简单的方法就是直接删除target文件目录下所有文件即可,再次启动idea的时候会重新生成


作者:jiankunking 出处:http://blog.csdn.net/jiankunking

原文链接:/xml/295023.html

猜你在找的XML相关文章