A query was run and no Result Maps were found for...原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误
今天遇到一个问题,原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误
报错的结果是这样的:
A query was run and no Result Maps were found for the Mapped Statement 'cn.zrgk.dao.RoleMapper.getRoleList'. It's likely that neither a Result Type nor a Result Map was specified.
org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'cn.zrgk.dao.RoleMapper.getRoleList'.
It's likely that neither a Result Type nor a Result Map was specified.
org.apache.ibatis.executor.resultset.FastResultSetHandler.validateResultMapsCount(FastResultSetHandler.java:177)
org.apache.ibatis.executor.resultset.FastResultSetHandler.handleResultSets(FastResultSetHandler.java:150)
org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:57)
org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:70)
org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:57)
org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:259)
org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:132)
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:105)
org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:81)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
java.lang.reflect.Method.invoke(Method.java:606)
我的mapper.xml文件中有个查询语句是这样写的:
大家看看图一,好像根本没有错误,对吗?再看看

是的,没错,我没有指定这个方法的返回类型,系统无法识别,于是就这样改了一下,发现不报错了

所以平时啊,我们要多多注意这些细节,更要去多加理解
A query was run and no Result Maps were found for...原来是mapper.xml文件出了问题,是使用MyBatis最常见的一种错误的更多相关文章
- A query was run and no Result Maps were found for the Mapped Statement 'user.insertUser!selectKey'. It's likely that neither a Result Type nor a Result Map was specified.
使用mybatis时出现异常问题: 有如下的错误 Error querying database. Cause: org.apache.ibatis.executor.ExecutorExceptio ...
- mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found
使用mybatis时出现异常问题: 有如下的错误 Error querying database. Cause: org.apache.ibatis.executor.ExecutorExcepti ...
- 出错:Cause: org.apache.ibatis.executor.ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'cn.mgy.mapper.UserMapper.findById'.
详细出错代码: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.a ...
- A query was run and no Result Maps were found for the Mapped Statement
mybatis测试方法报错: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exec ...
- mybatis使用map传递多参数报错:A query was run and no Result Maps were found for the Mapped Statement
在使用mybatis进行多参数传递时,报错: A query was run and no Result Maps were found for the Mapped Statement 'xx.xx ...
- ExecutorException: A query was run and no Result Maps were found for the Mapped Statement ‘com.win.mall.dao.CartMapper.test’. It’s likely that neither a Result Type nor a Result Map was specified.
ExecutorException: A query was run and no Result Maps were found for the Mapped Statement 'com.win.m ...
- mybatis报错:A query was run and no Result Maps were found for the Mapped Statement、、Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]问题解决
今天在做ssm项目的时候出现了: 先是出现 了错误: mybatis报错:A query was run and no Result Maps were found for the Mapped St ...
- mybatis报错:A query was run and no Result Maps were found for the Mapped Statement
转自:https://blog.csdn.net/u013399093/article/details/53087469 今天编辑mybatis的xml文件,出现如下错误: 程序出现异常[A quer ...
- mybatis mapper xml文件配置resultmap时,id行和result行有什么区别?
mybatis mapper xml文件配置resultmap时,id行和result行有什么区别? <resultMap id = "CashInvoiceMap" typ ...
随机推荐
- PHP(面向对象)连接数据库,实现基本的增删改查
https://blog.csdn.net/qq_37674858/article/details/78921485 --------------------- 本文来自 周子青 的CSDN 博客 , ...
- Python--多任务(多进程,多线程,协程)
1.单核CPU实现“多任务”:(注意:这里的多任务假的,是轮训执行多个任务一段时间) 1)时间片轮转 2)优先级调度算法 2.并行:真的多任务执行(CPU核数>=任务数):即在某个时刻点上,有多 ...
- Elasticsearch常见错误与配置简介
一.常见错误 1.1 root用户启动elasticsearch报错 Elasticsearch为了安全考虑,不让使用root启动,解决方法新建一个用户,用此用户进行相关的操作.如果你用root启动, ...
- (转)Linux用户登录记录日志和相关查看命令汇总
原文地址:http://www.cnblogs.com/lizhaoxian/p/5981029.html # 1 utmp.wtmp.btmp文件 Linux用户登录信息放在三个文件中: 1 /va ...
- 执行kubelet卡、解决
现象: 执行kubectl get po -o wide 非常卡.慢 原因: 修改node名称造成的, 解决: https://my.oschina.net/u/3390908/blog/164976 ...
- Zabbix介绍及安装(1)
Zabbix的介绍 一.什么是zabbix及优缺点(对比cacti和nagios) Zabbix能监视各种网络参数,保证服务器系统的安全运营:并提供灵活的通知机制以让系统管理员快速定位/解决存在的各种 ...
- bert系列二:《BERT》论文解读
论文<BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding> 以下陆续介绍ber ...
- kubeadm快速安装k8s
1.安装net-tools [root@localhost ~]# yum install -y net-tools 2.关闭firewalld [root@localhost ~]# systemc ...
- Apache——开启个人用户主页功能
个人主页功能分为不加密和加密两种 不加密: 先来建立几个用户,我这是建了两个 例:命令为:useradd qiyuan 然后输入:passwd qiyuan,改一下密码 我们看一下家目录下面: 已经 ...
- gitlab本地部署方法(ubuntu16.04+gitlab9.5.5)
Gitlab本地部署方法 1 前期准备 电脑配置:windows7 ,内存8GB以上(因为有4GB左右要分配给虚拟机中的ubuntu) 虚拟机:VMware Linux系统:ubuntu16.04 ...