【Mybatis】报错:Malformed OGNL expression: name!= null and name != ' '

【Mybatis】报错:Malformed OGNL expression: name!= null and name != ' '

英文感叹号和等号之间不能有空格;

nested exception is org.apache.ibatis.binding.BindingException: Parameter

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'productCode' not found. Available parameters are [prdRuleStageEntity, param1]
int updatePrdRuleStageEntity(Param("prdRuleStageEntity") PrdRuleStageEntity prdRuleStageEntity);

原因是mapper不应该有带 参数的注解。在xml中已经指定了parameter,就不要写@param

invalid comparison: java.util.Date and java.lang.String

org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String
### Cause: java.lang.IllegalArgumentException: invalid comparison: java.util.Date and java.lang.String

原来这是mybatis 3.3.0中对于时间参数进行比较时的一个bug. 如果拿传入的时间类型参数与空字符串''进行对比判断则会引发异常. 

<if test="createTime != null and createTime !='' " >
date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})
</if>
改为 <if test="createTime != null">
date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})
</if>

mybatis异常invalid comparison: java.util.Date and java.lang.String

Mybatis报错:There is no getter for property named 'xxxx' in 'class xxxx

一来是检查model中拼写是否错误,二来是检查映射的map是否正确

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题

解决org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题

这是一个很容易忽视的点,记住:接口名与Mybatis的映射文件名一定要一模一样。

mybatis异常集锦的更多相关文章

  1. MyBatis 异常 集锦

    异常1.使用映射器 (还没有使用Spring) 异常信息摘要: org.apache.ibatis.binding.BindingException: Type interface com.jege. ...

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

  3. mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long'

    mybatis 异常 There is no getter for property named 'bizId' in 'class java.lang.Long' 当使用mybatis进行传参的时候 ...

  4. mybatis异常invalid comparison: java.util.Date and java.lang.String

    原文链接:http://blog.csdn.net/wanghailong_qd/article/details/50673144 mybatis异常invalid comparison: java. ...

  5. mybatis异常:Could not find result map Java.util.Map 问题分析及解决 定位不到具体的位置的错误

    mybatis异常:Could not find result map Java.util.Map 问题分析及解决 报这个错误呢,很难受的就是你定位不到具体的地方,找不到位置修改,你只知道有错误,但是 ...

  6. Mybatis异常:java.lang.NumberFormatException: For input string: "S"

    MyBatis异常日志如下: Caused by: java.lang.NumberFormatException: For input string: "S" at sun.mi ...

  7. Mybatis异常_02_Result Maps collection already contains value for

    一.异常 1.异常信息 2.异常原因 XXXMapper.xml文件中存在重名对象,保持名称不要一样即可正常启动. 我的原因是namespace与其他mapper 一样. 3.可能的原因 (1)nam ...

  8. mybatis异常:nested exception is org.apache.ibatis.builder.BuilderException: Error resolving JdbcType

    异常详细 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...

  9. Mybatis异常There is no getter for property named 'XXX' in 'class com.xxx.xxx.UserAccountDTO

    mybatis报错异常信息如下: 解决: 在接口中加上注解:@Param("userAccountDTO"),如图

随机推荐

  1. Spark RDD :Spark API--图解Spark API

    面试题引出: 简述Spark的宽窄依赖,以及Spark如何划分stage,每个stage又根据什么决定task个数? Stage:根据RDD之间的依赖关系的不同将Job划分成不同的Stage,遇到一个 ...

  2. js语言评价--js 基于哈希表、原型链、作用域、属性类型可配置的多范式编程语言

    js 基于哈希表.原型链.作用域.属性类型可配置的多范式编程语言 值类型.引用类型.直接赋值: 原型是以对象形式存在的类型信息. ECMA-262把对象定义为:无序属性的集合,其属性可以包含基本值,对 ...

  3. 解决:C++ 中 main函数 wmain函数 _tmain函数 WinMain函数 wWInMain函数 _tWinMain函数的区别

    main函数与WinMain函数区别: 前者为控制台程序入口主函数,后者为Windows API窗体程序入口函数,在windef.h文件中定义. main函数与wmain函数 | WinMain函数与 ...

  4. Codeforces Round #603 (Div. 2) C. Everyone is a Winner! (数学)

    链接: https://codeforces.com/contest/1263/problem/C 题意: On the well-known testing system MathForces, a ...

  5. Numpy | 10 广播(Broadcast)

    广播(Broadcast)是 numpy 对不同形状(shape)的数组进行数值计算的方式, 对数组的算术运算通常在相应的元素上进行. 下面的图片展示了数组 b 如何通过广播来与数组 a 兼容. 4x ...

  6. podium micro-frontends 简单试用

    以下是一个简单的podium 试用,包含了layout 以及podlets,使用docker 运行 podium 主要包含了两大部分 podlets 片段服务 layouts 片段组合服务 环境准备 ...

  7. type of的返回值有哪些

    typeof 10; // number typeof 'time'; //string typeof undefined; // undefined typeof null; // object t ...

  8. Android Studio中每次打开工程Gradle sync龟速解决办法

    问题描述 自己使用android studio后,发现每次一打开工程,软件就在Grandle sync.sync就算了,而且这个步骤还必须过TZ,并且时间超级长,可能睡完觉起来还没有下载好.下面是正在 ...

  9. <转>python列表、元组、集合、字典、json相互转换以及其他基础入门

    列表元组转其他 # 列表转集合(去重) list1 = [6, 7, 7, 8, 8, 9] set(list1) # {6, 7, 8, 9} #两个列表转字典 list1 = ['key1','k ...

  10. OpenFOAM——冲击斜坡

    本算例来自<ANSYS Fluid Dynamics Verification Manual>中的VMFL045: Oblique Shock Over an Inclined Ramp ...