遇到一个很牛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. Android(java)学习笔记219:开发一个多界面的应用程序之两种意图

    1.两种意图: (1)显式意图: 在代码里面用intent设置要开启Activity的字节码.class文件: (2)隐式意图: Android(java)学习笔记218:开发一个多界面的应用程序之人 ...

  2. Aircrack-ng 工具箱

    官网为:http://www.aircrack-ng.org/, 它就是一个与WiFi 相关的工具啦,可以进行一些注入,抓包.破解WiFI等.里面有很多不同的套件. 另外,http://blog.cs ...

  3. noip 2015 运输计划 (lca+二分)

    /* 95 最后一个点T了 qian lv ji qiong 了 没学过树剖 听chx听xzc说的神奇的方法 Orz 首先求出每个计划的路径长度 这里写的倍增 然后二分答案 对于每个ans 统计> ...

  4. SQL Server强制删除发布

    今日发现SQL Server 中 存在以前(系统还原前)的发布内容,使用鼠标->右键,选择删除,失败.   可使用语句: EXEC SP_REMOVEDBREPLICATION '发布数据库名称 ...

  5. B/S系统间跨域单点登录设计思路

    基于B/S系统间单点登录 此处说的单点登录的概念,即不同系统公用一个登录界面.一处系统通过登录验证,在接入的各系统均为登录状态.一般有两种情景: 1)  一级域名相同 例如:tieba.baidu.c ...

  6. 知识点总结之HTML篇

    1.标签语义化: ①.在不依赖样式的情况下,页面能够呈现清晰的结构. ②.如果使用者有视觉障碍,屏幕阅读器会完全根据你的标记来选择读取你的网页. ③.有利于搜索引擎依赖于标记来确定上下文和各个关键字的 ...

  7. spring resttemplate中的转码

    /* * 初始化RestTemplate,RestTemplate会默认添加HttpMessageConverter * 添加的StringHttpMessageConverter非UTF-8 所以先 ...

  8. When Colon Scripting is comming

    当冒号脚本来临-- 前一篇<JSON带来编程界怎样的描述>,已经展开了一种脚本设计概念,以此诞生的脚本语言待定义的语法不多.但总归需要经历各种语言描述能力对比来归纳最终友好特性的. 冒号已 ...

  9. Adb shell 常用命令

    1. 查看IP adb shell netcfg 2. 查看挂载设备 adb devices 3. 将本地端口转发至手机端口 adb forward tcp: tcp: // PC上所有6100端口通 ...

  10. Extjs中Chart利用series的tips属性设置鼠标划过时显示数据

    效果如下: 从官网找到的例子,大家参考下吧.源码: Ext.require('Ext.chart.*'); Ext.require('Ext.layout.container.Fit'); Ext.o ...