【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. crontab每小时运行一次(转)

    https://blog.csdn.net/liu0808/article/details/80668705 先给出crontab的语法格式 对于网上很多给出的每小时定时任务写法,可以说绝大多数都是错 ...

  2. hive中删除表的错误Error, return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException

    hive使用drop table 表名删除表时报错,return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask. MetaException 刚 ...

  3. Bomb Enemy

    Description Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number z ...

  4. AttributeError: Can only use .str accessor with string values, which use np.object_ dtype in pandas

    忘记网址了…… 问题: 分析思路与解决方法:

  5. Vue的SEO问题汇总

    方式一 思否 https://segmentfault.com/q/1010000011824706 SSR 和 Nuxt.js : https://zh.nuxtjs.org/ https://se ...

  6. HHHOJ #151. 「NOI模拟 #2」Nagisa

    计算几何板子题(我才没有拷板子的说--) 众所周知,三角形的重心坐标是\((\frac{x_1+x_2+x_3}{3},\frac{y_1+y_2+y_3}{3})\) 然后我们发现如果我们有一个点集 ...

  7. Linux防火墙配置方法

    1)查看防火墙状态 查看防火墙状态: /etc/init.d/iptables status 暂时关闭防火墙: /etc/init.d/iptables stop 重启防火墙: /etc/init.d ...

  8. Linux禁止ping和开启ping的方法

    Linux默认是允许Ping响应的,系统是否允许Ping由2个因素决定的:A.内核参数,B.防火墙,需要2个因素同时允许才能允许Ping,2个因素有任意一个禁Ping就无法Ping.   一.通过修改 ...

  9. oracle 如何通过分组计数查出重复数据?

      1.情景展示 现在,机构表数据中机构名称有重复数据,如何筛选出来? 2.分析 第一步:统计是否存在重复数据. 方式一: 方式二: 说明表中确实存在重复数据 第二步:统计重复次数及机构名称. 需要通 ...

  10. [原创]STAR法则

    [原创]STAR法则 STAR法则是情境(situation).任务(task).行动(action).结果(result)四项的缩写. STAR法则是一种常常被面试官使用的工具,用来收集面试者与工作 ...