1、异常提示:

  org.apache.ibatis.binding.BindingException: Mapper method 'com.artup.dao.WorksDao.selectWorksIsCropCompletedById attempted to return null from a method with a primitive return type (byte).

2、原因:在使用 MyBatis 时,写了个查询语句,其返回值设置为了 byte 类型,当从数据库中能够查询到数据时,不会报错;当前查询不到数据时则会抛出此异常,是由于 null 不能够直接转换成 byte 类型导致的,我们可以将返回类型设置为对象 Byte,从而能够接收值为 null 的情况。

3、解决办法:

  3.1 将所有查询到的数据的值都设置为数字;

    或者
  3.2 将返回的类型由 byte 改成 Byte 从而能够接收 null 类型的值。

  

org.apache.ibatis.binding.BindingException的更多相关文章

  1. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):

    org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): da.huying.usermanag ...

  2. Exception:HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    主要错误信息如下: HTTP Status 500 - org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  3. mybatis使用时org.apache.ibatis.binding.BindingException: Invalid bound statement (not found):的错误

    最近在使用mybatis时,出现了 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): 这 ...

  4. IDEA异常解决: org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)

    有时候解决问题不仅仅是解决问题.-----jstarseven 最近因为开发需要,需要搭建一个ssm开发框架,采用了开发工具IDEA. 整合完了SSM开发框架之后,发布的时候出现org.apache. ...

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

  6. 通过maven test 报org.apache.ibatis.binding.BindingException: Invalid bound statement

    背景 直接使用eclipse工具去执行,没有问题,通过testng.xml去执行,没有问题,但通过mvn clean test执行,就报错,提示org.apache.ibatis.binding.Bi ...

  7. ### Cause: org.apache.ibatis.binding.BindingException: Parameter 'name' not found. Available parameters are [arg1, arg0, param1, param2]

    org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. Cause: org.apache.ib ...

  8. 怪事年年有,今天特别多!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 ...

  9. org.apache.ibatis.binding.BindingException: Invalid bound statement (not found): cn.e3mall.search.mapper.ItemMapper.getItemList

    java.lang.RuntimeException: org.apache.ibatis.binding.BindingException: Invalid bound statement (not ...

  10. MyBatis 传List参数 nested exception is org.apache.ibatis.binding.BindingException: Parameter 'idList' not found.

    在MyBatis传入List参数时,MyBatis报错:nested exception is org.apache.ibatis.binding.BindingException: Paramete ...

随机推荐

  1. CF765F Souvenirs 离线+线段树+主席树

    $ \color{#0066ff}{ 题目描述 }$ A县旁,连绵着一条长度为 n 的山脉,这条山脉由 n 座山峰组成,第 i 座山 峰的高度为 ai.作为著名的旅游县城,每天来到山脉游玩的旅客络绎不 ...

  2. noip提高组模拟赛(QBXT)T2

    T2count题解 [ 问题描述]: 小 A 是一名热衷于优化各种算法的 OIER,有一天他给了你一个随机生成的 1~n 的排列, 并定 义区间[l,r]的价值为: \[ \huge C_{l,r}= ...

  3. HTML-CSS样式表-★★★常用属性★★★及基本概念、分类、选择器

    样式属性 背景与前景: background-color:#F90; /*背景颜色,样式表优先级最高*/ background-image:url(路径); /*设置背景图片(默认)*/ backgr ...

  4. jquery将json数据放入表格当中

    数据: var datas = [{ name:"淘宝", url:"www.taobao.com", type:"购物网站" },{ na ...

  5. python爬虫urllib库使用

    urllib包括以下四个模块: 1.request:基本的HTTP请求模块,可以用来模拟发送请求.就像在浏览器里输入网址然后回车一样,只需要给库方法传入URL以及额外的参数,就可以模拟实现这个过程. ...

  6. SpringMVC的JSP页面中中EL表达式不起作用的问题解决

    原文地址:https://blog.csdn.net/sinat_35512245/article/details/53611663

  7. (一)Win消息机制,SDK编程基础

    一,基本概念 SDK:软件开发工具包(缩写:SDK.外语全称:Software Development Kit) API:应用程序接口 WINAPI:Windows平台下的系统调用,包含 window ...

  8. String字符串补位

    String类的format()方法用于创建格式化的字符串以及连接多个字符串对象.熟悉C语言的读者应该记得C语言的sprintf()方法,两者有类似之处.format()方法有两种重载形式. l    ...

  9. mybatis的CRUD实例(四)

    接下来我们来实现新增用户功能: 一.新增用户 这里我们使用的sql为:insert into user(username,birthday,sex,address) values ("lwj ...

  10. 洛谷 P2053 [SCOI2007]修车(最小费用最大流)

    题解 最小费用最大流 n和m是反着的 首先, \[ ans = \sum{cost[i][j]}*k \] 其中,\(k\)为它在当前技术人员那里,排倒数第\(k\)个修 我们可以对于每个技术人员进行 ...