Mayatis 异常之result maps collection already contains value...

这个异常,用过myBatis的肯定都是见过的,除了网上说的,一个mapper.xml文件中的id重复,还有很多错误会导致这个异常,最近工作中遇到很多新的原因导致该异常,收集如下供大家参考:

1,xml文件中的id重复,修改id即可

2,resulttype和resultmap属性使用混乱,该用resultType的时候不能用resulttype

3,命名空间错误,什么意思?就是最好尽量用完整的包名+类名,这点包括很多情况,有时候属性value中多一个空格都不行,‘xxx.aVo‘和‘ xxx.aVo‘是不一样的

4,注意检查xml文件与mapper.java接口的对应情况,保证一一对应且唯一

5,发现后持续更新收集

 

时间: 2024-11-05 00:10:00

Mayatis 异常之result maps collection already contains value...的相关文章

mybatis 异常Result Maps collection does not contain value for java.lang.String

Result Maps collection does not contain value for java.lang.String 以上是我报的错. 只要报Result Maps collection does not contain value for*****的错误都是同一种错误. 问题排查: 从异常信息里无法看出具体是哪里出了错误.只提示调用出现错误的地方.但是经过检查后明显错误不是再此处的代码. 经过每个问题文件进行移除,一次次运行进行排查问题最终找到了错误的地方,处于一个xml里面的

MyBatis错误:Result Maps collection already contains value for novel.storage.mapper.NovelMapper.BaseResultMap

今天在写项目的时候遇到一个问题如下: org.apache.ibatis.exceptions.PersistenceException: ### Error building SqlSession.### The error may exist in NovelMapper.xml### The error occurred while processing mapper_resultMap[BaseResultMap]### Cause: org.apache.ibatis.builder.

MyBatis出错Result Maps collection does not contain value for java.lang.Integer

Servlet.service() for servlet [SpringMVC] in context with path [/eyou] threw exception [Request processing failed; nested exception is org.apache.ibatis.builder.IncompleteElementException: Could not find result map java.lang.Integer] with root causej

mybatis中Invalid bound statement (not found) 和 Result Maps collection already contains value for...错误解决方案

一.Invalid bound statement (not found) 使用mybatis有时候会报Invalid bound statement (not found)这种错误,总结了下,可能有两种情况如下: 1.mybatis的对应的mapper.xml找不到对应的命名sql或者名称与mapper接口名称不一致. 2.xml文件与接口名称都对,但是在mybatis配置文件中漏掉了配置,也会报这种错误. 二.Result Maps collection already contains v

mybatisGenerator 代码自动生成报错 Result Maps collection already contains value for BaseResultMap

由于mybatis简单易学,比起Hibername来,更容易上手,代码也能自动生成.这几天研究了下代码自动生成的,参考: http://0609xiaohua.iteye.com/blog/1453570 但是把代码复制进来,运行了下,却跑不起来,报以下错误: Exception in thread "main" java.lang.ExceptionInInitializerError at com.test.Test.main(Test.java:12)Caused by: org

Result Maps collection already contains value for

Caused by: java.lang.IllegalArgumentException: java.lang.RuntimeException: Error parsing Mapper XML. Cause: java.lang.IllegalArgumentException: Result Maps collection already contains value for com.ysten.cdn.check.notice.repository.mapper.NoticeSourc

解决Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.geek.dao.ContentDao.Integer

mybatis报错:Caused by: java.lang.IllegalArgumentException: Result Maps collection does not contain value for com.geek.dao.ContentDao.Integer 出错原因:一个手误 <select id="selectAllFirstNavigationName" resultMap="firstNavigation"> SELECT fi

Result Maps collection already contains value for org.gwj.ssm.dao.CompanyMapper.BaseResultMap

八月 01, 2017 2:48:13 下午 org.apache.tomcat.util.digester.SetPropertiesRule begin 警告: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:ssm' did not find a matching property. 八月 01, 2017 2:4

Spring Boot Mybatis Result Maps collection already contains value for *.BaseResultMap

当你复制一个*Mapper.xml文件到项目工程中,运行报错Mybatis Result Maps collection already contains value for *.BaseResultMap时,教你两步解决. 1.删除对应的这个*Mapper.xml文件,启动下项目,让其报下错. 2.然后再复制文件上去,再次启动就OK了.