遇到一个很牛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. java的通信机制

    通信机制无非就那几种:http访问.socket访问: http又分为:jsp.servlet.html,用的就是get和post方法 socket则可分为:tcp或者udp方式 从以上内容又衍生出其 ...

  2. Android 发送验证码 简易代码

    效果 Activity ;//倒计时 private Timer timer; private Handler handler = new Handler() { public void handle ...

  3. [转载]使用兼容ie6 ie7 ie8 FF的text-overflow:ellips

    使用兼容ie6 ie7 ie8 FF的text-overflow:ellipsis超出文本显示省略号来代替截取函数更有利于seo,如果使用截取函数,源代码中的标题是显示不完整的,即便是在title属性 ...

  4. Mac下Sublime快捷键

    由于自己笔记本是mac,造成window与mac中sublime快捷键不同,现在稍微整理下常用的方便于记忆: 1.control+alt+enter 打开Emmet(Zencoding) 2.supe ...

  5. java中对象的转型

    1.对象的向上转型——将子类的对象赋值给父类的引用 Student s=new Student();  Person p=s; 一个引用能够调哪些成员(变量和函数),取决于这个引用的类型  也就是Pe ...

  6. 一个tomcat部署俩个java web项目

    2.发布的时候可以发布成war包,用项目名称右键export,选择项目名称,还有发布的路径,即tomcat下的路径,参考http://zhidao.baidu.com/link?url=imOu0Uu ...

  7. Maven Profile标签

    Maven Profiles标签可以针对不同的环境来使用不同的配置文件 在发布的时候可以用 mvn release -p product mvn release -p test mvn release ...

  8. asp.net实现 EXCEL数据导入到数据库功能

    在项目中经常要用EXCEL导入数据到数据库,提高工作效率. 注意:EXCEL中的第一行不能导入. 下面是源码: IntoExcel.aspx: [csharp] <%@ Page Languag ...

  9. html5插入视频

  10. canvas 背景填充

    这儿介绍canvas的ccreatePattern函数, context.createPattern(Image,"repeat"),还可以repeat-x,reapter-y 还 ...