遇到一个很牛X的问题。当MyBatis的foreach中item='cr'时,程序居然抛出异常:
19:07:55.338 DEBUG c.l.dao.PageMapper.selectByCriteria - ==>  Preparing: select id, pag_id, title, content, status, create_date, modified_date from page WHERE ( pag_id = ? and status = ? ) order by modified_date desc 
19:07:55.378 DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@3f68f2a4]
19:07:55.379 DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
19:07:55.382 DEBUG o.a.struts2.dispatcher.Dispatcher - Exception occurred during processing request: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cr_0iterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cr_0iterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
    ……
Caused by: org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cr_0iterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
    ……
当把cr改成c后,程序依然异常:
19:11:35.496 DEBUG c.l.dao.PageMapper.selectByCriteria - ==>  Preparing: select id, pag_id, title, content, status, create_date, modified_date from page WHERE ( pag_id = ? and status = ? ) order by modified_date desc 
19:11:35.531 DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@270b6d1c]
19:11:35.532 DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
19:11:35.534 DEBUG o.a.struts2.dispatcher.Dispatcher - Exception occurred during processing request: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__fr__frch_c_0h_criterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__fr__frch_c_0h_criterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
……
Caused by: org.apache.ibatis.binding.BindingException: Parameter '__fr__frch_c_0h_criterion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
    
当改成cri后,异常依旧在:
19:13:33.702 DEBUG c.l.dao.PageMapper.selectByCriteria - ==>  Preparing: select id, pag_id, title, content, status, create_date, modified_date from page WHERE ( pag_id = ? and status = ? ) order by modified_date desc 
19:13:33.740 DEBUG org.mybatis.spring.SqlSessionUtils - Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@76d56dba]
19:13:33.740 DEBUG o.s.jdbc.datasource.DataSourceUtils - Returning JDBC Connection to DataSource
19:13:33.742 DEBUG o.a.struts2.dispatcher.Dispatcher - Exception occurred during processing request: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cri_0terion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cri_0terion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]
……
Caused by: org.apache.ibatis.binding.BindingException: Parameter '__frch___frch_cri_0terion_1' not found. Available parameters are [col, param1, page, param2, param3, wcriteria]

当改成criteria后,程序就正常了,起初我还以为是item对长度有限值,可是没听说啊。于是决定把cr改成ab试一下,奇迹不总是发生在长度上,居然没有异常。不晓得MyBatis是不是在哪个不起眼的地方对这个问题有说明,也或许他是一个bug,不管是哪种情况,如果你也遇到了,希望对你有帮助。

MyBatis Parameter not found的更多相关文章

  1. Projected coordinate systems 和 wkid

    Projected coordinate systems Well-known ID Name Well-known text 2000 Anguilla_1957_British_West_Indi ...

  2. 解决mybatis foreach 错误: Parameter '__frch_item_0' not found

    解决mybatis foreach 错误: Parameter '__frch_item_0' not found 在遍历对象的属性(是ArrayList对象)时报错: org.mybatis.spr ...

  3. mybatis异常:Improper inline parameter map format. Should be: #{propName,attr1=val1,attr2=val2}问题分析及解决

    转载自:http://blog.csdn.net/jackpk/article/details/44158701 mybatis异常:Improper inline parameter map for ...

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

  5. spring 整合Mybatis 错误:Parameter 'items_id' not found. Available parameters are [array]

    运行环境:jdk1.7.0_17+tomcat 7 + spring:3.2.0 +mybatis:3.2.7+ eclipse 错误:Parameter 'items_id' not found. ...

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

  7. mybatis 批量更新 Parameter '__frch_item_0' not found. Available parameters are [list]

    一次在做批量更新数据的时候报错 Parameter '__frch_item_0' not found. Available parameters are [list] 记过反复查找,最后才发现是一个 ...

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

  9. SpringBoot整合Mybatis注解版---update出现org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found. Available parameters are [arg1, arg0, param1, param2]

    SpringBoot整合Mybatis注解版---update时出现的问题 问题描述: 1.sql建表语句 DROP TABLE IF EXISTS `department`; CREATE TABL ...

随机推荐

  1. [转] Linux中gcc,g++常用编译选项

    http://blog.sina.com.cn/s/blog_5ff2a8a201011ro8.html gcc/g++ 在执行编译时,需要4步 1.预处理,生成.i的文件[使用-E参数] 2.将预处 ...

  2. Oracle sequence排序的使用

    最近公司的项目中好多用到了Seq排序的,所以网上找些记录一下吧. 通过以下直接查询出所有的seq列表: select * from user_sequences; 查询结果如下: 查询结果和创建的基本 ...

  3. (转)H264(NAL简介与I帧判断)

    1.NAL全称Network Abstract Layer, 即网络抽象层.         在H.264/AVC视频编码标准中,整个系统框架被分为了两个层面:视频编码层面(VCL)和网络抽象层面(N ...

  4. 修改DeDe标签Pagelist分页样式

    我们在用dede仿站的时候,调用文章列表页的分页时,我们会用到: {dede:pagelist listitem=”info,index,end,pre,next,pageno” listsize=” ...

  5. centos 6.X 安装node

    1.源码安装 Source Code yum -y install gcc make gcc-c++ openssl-devel wget //yum下载相关的依赖包 wget http://node ...

  6. 合(析)取范式转主合(析)取范式--》Java实现

    这次老师布置了如下上机作业,不限语言.思前想后,问了几个大神,说了一堆不知道什么鬼的算法名称.... 经过一番百度,发现Java可以包含库然后使用JavaScript的一些函数,其中eval() 函数 ...

  7. directshow filter 调试步骤

    1,编写filter 2,在debug模式下build 3,注册filter:控制台cd到工程的debug目录下,即欲注册的filter(.ax文件)目录,xx:>regsvr32 contra ...

  8. javascript之attribute 和 property

    首先看看这两个单词的英文释义(来自有道词典).先是property: property ['prɔpəti] n. 性质,性能:财产:所有权 英英释义: any area set aside for ...

  9. 使用wireshark抓本机之间的包(转)

    所转地址:http://www.chinadmd.com/file/oc6evrwtzieitexvoupppisr_1.html 在进行通信开发的过程中,我们往往会把本机既作为客户端又作为服务器端来 ...

  10. 安装 vsftp

    1.yum安装 vsftp yum list vsftpd yum install vsftpd 2.配置 vsftp 将root注释掉 vi /etc/vsftpd/ftpusers 将root注释 ...