今天在做ssm项目的时候出现了:

先是出现 了错误:

mybatis报错:A query was run and no Result Maps were found for the Mapped Statement

这是因为Dao.xml中的select标签中必须指定要返回的值的类型(注意:是返回值的单个类型,即如果你是返回一个List<User>的话,需要指定的是User)

具体的这种错误的解决办法见:https://www.cnblogs.com/isme-zjh/p/11757155.html

当我解决完之后,又出现了一个新的问题:见下面:

Caused by: org.apache.ibatis.exceptions.PersistenceException: ### 。。。。
The error may involve com.thinkgem.jeesite.common.permission.dao.PremissUserDao.getPremissUserList ### The error occurred while handling results

原因:一般都是自己的Dao对应的xml文件出了问题

我这里是select 标签的id指定了,大但是select标签中的查询语句返回的类型没有指定,也就是没有resultType参数,还有一个需要注意的点是:这里参数需要指定的是返回的单个的java类型,即是如果你通过查询需要返回的是一个lIst<xxx>的话,你在这个参数的位置也需要指定的是单个的java的类型,而不是指定为java.util.List

错误的代码

   <select id="getPremissUserList" resultType="java.util.List">
select
<include refid="premissUserColumns"/>
from premiss_user u
<include refid="premiss_user_join"/>
</select>

项目的时候出现了:

Caused by: org.apache.ibatis.exceptions.PersistenceException: ### 。。。。

The error may involve com.thinkgem.jeesite.common.permission.dao.PremissUserDao.getPremissUserList ### The error occurred while handling results

原因分析:

我自己去 网上查的时候发现大家出现【Caused by: org.apache.ibatis.exceptions.PersistenceException:】错误的时候,大多是自己的Mapper配置文件除了问题,所以去仔细检查自己的Mapper.xml吧!

我这里是select 标签的id指定了,大但是select标签中的查询语句返回的类型没有指定,也就是没有resultType参数,还有一个需要注意的点是:这里参数需要指定的是返回的单个的java类型,即是如果你通过查询需要返回的是一个lIst<xxx>的话,你在这个参数的位置也需要指定的是单个的java的类型,而不是指定为java.util.List

错误的代码

<select id="getPremissUserList" resultType="java.util.List">

select

<include refid="premissUserColumns"/>

from premiss_user u

<include refid="premiss_user_join"/>

</select>

正确的:

<select id="getPremissUserList" resultType="com.thinkgem.jeesite.common.permission.entity.PremissUser">
select
<include refid="premissUserColumns"/>
from premiss_user u
<include refid="premiss_user_join"/>
</select>

之后又遇见的一个新的问题:这个应该是相应的用到login_ip的jsp文件出了问题

十月 ,  :: 上午 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet [springServlet] in context with path [/Demo] threw exception [javax.el.PropertyNotFoundException: Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]] with root cause
javax.el.PropertyNotFoundException: Property [login_ip] not found on type [com.thinkgem.jeesite.common.permission.entity.PremissUser]

问题出现

更改为user这个实体类中有的loginIp即可

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]问题解决的更多相关文章

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

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

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

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

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

  6. 出错: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 ...

  7. mybatis配置文件xxxx.xml中缺失返回类型的后果A query was run and no Result Maps were found

    使用mybatis时出现异常问题: 有如下的错误 Error querying database.  Cause: org.apache.ibatis.executor.ExecutorExcepti ...

  8. 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 f ...

  9. mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types () or values ()

    mybatis报错 Error instantiating interface com.atguigu.mybatis.dao.DepartmentMapper with invalid types ...

随机推荐

  1. Linux网络课程学习第六天

    本节课程主要内容:针对第四章节进行了收尾,以及对第五章的用户身份与文件权限进行了详细讲解. 学习心得:干货很多,收获满满.

  2. phpcms v9 标签调用,函数,sql

    1.截取调用标题长度 {str_cut($r[title],36,'')} 2.格式化时间 调用格式化时间 2011-05-06 11:22:33 {date('Y-m-d H:i:s',$r[inp ...

  3. 题解 P1056 【排座椅】

    题目地址:https://www.luogu.com.cn/problem/P1056 题解原地址:https://createsj.blog.luogu.org/solution-p1056 由于题 ...

  4. Dubbo-服务注册中心之AbstractRegistry

    在dubbo中,关于注册中心Registry的有关实现封装在了dubbo-registry模块中.提供者(Provider)个消费者(Consumer)都是通过注册中心进行资源的调度.当服务启动时,p ...

  5. 2020牛客寒假算法基础集训营1 I-nico和niconiconi

    #include <bits/stdc++.h> #define dbg(x) cout << #x << "=" << x < ...

  6. Python基本数据类型set方法概述

    li=[1,2,3,4,5,6,3,2,1] s2 = set(li) print(set(li)) #difference()去除相同项,生成一个新的集合,删除 s3=s2.difference([ ...

  7. win10驱动签名禁用与启动

    禁用:https://jingyan.baidu.com/article/624e74594dbc8d34e8ba5aa6.html?qq-pf-to=pcqq.c2c 启用或恢复:https://z ...

  8. oracle sql 数据库之间导入数据

    1.导入别的表 insert into EMPI_IDENTIFY select id,empiid, name||':' ||idcardno,'accidcardno','' from empi_ ...

  9. HandlerMethod解析

    api写HandlerMethod的作用: Encapsulates information about a handler method consisting of a method and a b ...

  10. R parallel包实现多线程1

    并行执行 Yes! Well done! Socket clusters are initialized without variables, so a_global_var wasn't found ...