IllegalArgumentException: XML fragments parsed from previous mappers already contains value for *

今天写代码过程中碰到控制台报上面的错误,找了好长时间,终于发现问题所在。

因为我的mapper.xml是copy过来后改的名字,网上看了好几个,都没能解决我的问题,最后借鉴(https://blog.csdn.net/jiankunking/article/details/51857820),结合自己项目的实际情况,成功解决bug。

最开始我用idea的全局搜索,始终搜索出来错误信息里的提示只有一个,后来又去workspace中的target目录下去找,果然找到了两个同名的mapper.xml文件,我想把单个文件删除,结果还删除不了,只能把target文件夹下的我的项目删了,然后重启idea,重新编译,重新install,重启服务,搞定。

 

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sqlSessionFactory' defined in file [E:\IDEA2018workspace\***\target\***\WEB-INF\classes\spring-context.xml]: Invocation of init method failed; nested exception is org.springframework.core.NestedIOException: Failed to parse mapping resource: 'file [E:\IDEA2018workspace\***\target\jingyou\WEB-INF\classes\com\****\yzsd\modules\jcdy\mapper\JcdyApplyDao.xml]'; nested exception is org.apache.ibatis.builder.BuilderException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: XML fragments parsed from previous mappers already contains value for com.***.yzsd.modules.jcdy.dao.JcdyApplyDao.jcdyApplyColumns

 

你可能感兴趣的:(work)