报错的原因翻译出来:

预期的一个结果(或null)返回selectOne(),但发现:3

意思就是你想得到一个结果值,但是返回了三个结果值.

一般可能测试的时候我们存了几条一样的数据,在登录时,会把同用户名数据都返回.但是mapper接口的返回值是一个Bean.所以报错.

解决方法:

可以修改返回值为list,然后获取第一条

或者把数据库中重复的数据删掉.

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 3报错解决的更多相关文章

  1. HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

    HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.e ...

  2. 错误信息: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

    这个错误主要原因是:数据库的配置出问题,比如写错库名什么的,仔细检查下.

  3. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'username' not found. Available parameters are [1, 0, param1, param2]

    Spring+mybatis错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.bi ...

  4. 解决:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'requestMap.maintenancename != null and requestMap.maintenance

    异常如下:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...

  5. 怪事年年有,今天特别多!org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'empno' not found. Available parameters are [emp, deptno, param1, param

    错误: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.Binding ...

  6. 【异常及源码分析】org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping: ParameterMapping

    一.异常出现的场景 1)异常出现的SQL @Select("SELECT\n" + " id,discount_type ,min_charge, ${cardFee} ...

  7. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'userId' not found. Available parameters are [arg1, arg0, param1, param2]

    2018-06-27 16:43:45.552  INFO 16932 --- [nio-8081-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : ...

  8. SpringMvc错误:HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is n

    HTTP Status 500 - Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemExc ...

  9. org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'socialCode' in 'class java.lang.String'

    异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Refl ...

随机推荐

  1. Git用在公司项目上的操作

    修改代码后再次提交 搭档优化好他自己的代码后,我想在vscode上看看他优化后的结果 此时直接git pull origin就可以看到了 j接下来的一些指令,慢慢了解... 分支本身已经在我上面 以下 ...

  2. python简单小程序

    #足球队寻找10 到12岁的小女孩(包含10岁和12岁),编写程序询问用户性别和年龄,然后显示一条消息指出这个人是否可以加入球队,询问10次,输出满足条件的总人数#询问10次,输出满足要求的总人数 o ...

  3. Mac 安装Maven,并设置环境变量

    1 / 打开电脑,找到终端命令行工具,输入maven环境变量查询工具: mvn -v 2 / 执行上述命令后,此时没有安装的两个提示信息,一个时没有mvn命令,一个时没有安装maven.执行下面命令开 ...

  4. 保存会话数据的两种技术,Cookie,Session

    CookieCookie是客户端技术,服务器把每个用户的数据以cookie的形式写给用户各自的浏览器.当用户使用浏览器再去访问服务器中的web资源时,就会带着各自的数据去.这样,web资源处理的就是用 ...

  5. 014 Ceph管理和自定义CRUSHMAP

    一.概念 1.1 Ceph集群写操作流程 client首先访问ceph monitor获取cluster map的一个副本,知晓集群的状态和配置 数据被转化为一个或多个对象,每个对象都具有对象名称和存 ...

  6. node多进程的创建与守护

    node是单线程运行,我们的node项目如何利用多核CPU的资源,同时提高node服务的稳定性呢? 1. node的单线程 进程是一个具有一定独立功能的程序在一个数据集上的一次动态执行的过程,是操作系 ...

  7. Python学习3月5号【python编程 从入门到实践】---》笔记(2)

    1.操作列表 一.遍历整个列表,并且想对每一个元素执行相同的操作.##这里就不得不提起我们一直用的For函数了. 二.深入地研究循环 (1)for  i  in superheroes:##首先读取其 ...

  8. 三分钟学会使用Docker部署.NET Core

    大概快有一年的时间没有碰过docker了,理由很简单,基本上都是在IIS上部署,看到很多大佬都开始Devops持续化集成了,但相对来说成本会更高,但对于大型团队来说还是不错的,这不?不想被大伙甩下,哈 ...

  9. shell 概览

    shell能做什么: 1. 自动化批量系统初始化程序(update,软件安装,时区设置,安全策略...) 2. 自动化批量软件部署程序(LAMP,LNMP,Tomcat,LVS,Nginx) 3. 管 ...

  10. spring之为什么要使用事务?

    问题描述:现在我们有一个数据库:spring 三张表:account.book.book_stock account存储着用户以及账户余额.book存储着书号.名字和 购买一本所需金额.book_st ...