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里面的一个查询语句,里面写了resultMap="java.lang.String"导致,而正确的应该是resultType="java.lang.String"

类似该问题都是这样导致的。

编写mapper.xml时候一定要留意,spring启动时以及报错时是不会准确提示异常信息的位置。切记。

原文地址:https://www.cnblogs.com/wulm/p/8277721.html

时间: 2024-07-29 16:39:36

mybatis 异常Result Maps collection does not contain value for java.lang.String的相关文章

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报错Result Maps collection does not contain value for java.lang.Integer

解决办法:1.检查mybatis的xml配置 2.在某处肯定有配错了的,如"resultMap" -->"resultType" [html] view plain copy<select id="getNumDayMoney" resultMap="java.lang.Integer" parameterType="java.lang.Integer"> <![CDATA[ sel

Mybatis异常_02_Result Maps collection already contains value for

一.异常 1.异常信息 2.异常原因 XXXMapper.xml文件中存在重名对象,保持名称不要一样即可正常启动. 二.参考资料 1.Mybatis启动报Result Maps collection already contains value for ...的问题 1.mybatis(错误一) 项目启动时报“Result Maps collection already contains value forxxx”的解决方案 2.Mybatis异常-Result Maps collection

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中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

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了.

mybatis(错误一) 项目启动时报“Result Maps collection already contains value forxxx”的解决方案

Result Maps collection already contains value for xyx.dsw.dao.mapper.admin.quotationwish.TempTestTableMapper.TempTestTableResult 一  错误信息: [html] view plain copy 19:26:05,446 ERROR [org.mybatis.spring.mapper.MapperFactoryBean] (org.mybatis.spring.mapp

MyBatis:Parameter Maps collection does not contain value for 的问题解决

发现配置: Java代码   <resultMap type="com.demo.sys.entity.Module" id="moduleMap"> <id property="id" column="id" /> <result property="name" column="name" /> <result property="r

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