Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")
今天在使用mybatis处理数据库的时候,突然抛出了上述异常,让我感到很惊讶,因为在处理save的时候,在Mybatis的配置文件中,我根本就没有使用到ognl表达式,系统怎么会抛出上述异常。而且之前也是这么使用的,也没见抛出上述异常。然后查看操作数据库的Mybatis的配置文件,倒是找到了几个错误,但是都不是引起这个异常的原因。然后,再仔细查看这个配置文件,突然之间,发现了,在该配置文件:
<!-- save -->
<insert id="save">
insert into qa_sampling(s_id ,
s_mil_id ,
s_samplingPackage ,
s_samplingWeight ,
s_samplingPerson_id ,
s_samplingCardFill ,
s_samplingDate ,
s_createTime)
values(#{s_id} ,
${s_mil.mil_id} ,
#{s_samplingPackage} ,
#{s_samplingWeight} ,
#{s_samplingPerson.u_id} ,
#{s_samplingCardFill} ,
#{s_samplingDate} ,
#{s_createTime})
</insert>
${s_mil.mil_id} , 这一处,居然是使用$,难怪系统将其作为表达式进行解析,将其修改成”#”之后,一切OK,上述异常成功解决。现,贴出正确的写法:
<!-- save -->
<insert id="save">
insert into qa_sampling(s_id ,
s_mil_id ,
s_samplingPackage ,
s_samplingWeight ,
s_samplingPerson_id ,
s_samplingCardFill ,
s_samplingDate ,
s_createTime)
values(#{s_id} ,
#{s_mil.mil_id} ,
#{s_samplingPackage} ,
#{s_samplingWeight} ,
#{s_samplingPerson.u_id} ,
#{s_samplingCardFill} ,
#{s_samplingDate} ,
#{s_createTime})
</insert>
Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")的更多相关文章
- root cause org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "XXX")
在执行一个查询语句的时候,mybatis报错:root cause org.apache.ibatis.ognl.OgnlException: source is null for getProper ...
- org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "enterpCd")-Mybatis报错
一.问题由来 下午快要下班时,登录测试服务器查看日志信息,看看有没有新的异常信息,如果有的话好及时修改.结果一看果然有新的异常信息. 主要的异常信息如下: 2020-10-13 14:51:03,03 ...
- 解决:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression 'requestMap.maintenancename != null and requestMap.maintenance
异常如下:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.Builde ...
- source is null for getProperty(null, "cpmodel")异常结局
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderExce ...
- Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'
本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...
- Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'company' in 'class java.lang.String'
Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ' ...
- [mybatis错误] - sql出错 org.apache.ibatis.ognl.ParseException: Encountered "!" at line 1, column 15. Was expecting one of:
完整异常:Caused by: org.apache.ibatis.builder.BuilderException: Error evaluating expression 'developerTy ...
- Caused by: org.apache.ibatis.reflection.ReflectionException我碰到的情况,原因不唯一
映射文件: <select id="selectKeyByUserId" resultMap="Xxx"> <![CDATA[ ...
- Caused by: org.apache.ibatis.binding.BindingException: Parameter 'parameter' not found.解决
Caused by: org.apache.ibatis.binding.BindingException: Parameter 'company' not found. Available para ...
随机推荐
- 关于 mod_python
首先声明 本文 翻译 别人的文章,文章的作者是 mod_python 项目的负责人,目前 mod_python已由 Apache维护.原文地址: http://www.onlamp.com/pub/a ...
- jQuery plugin
SidebarJS http://makotot.github.io/sidebar/
- 统计指定时间段的访问真正WEB页面(去除静态请求)的IP的TOP100排行
最近就在磨这个脚本以达到SEO同事要求哈. awk -v b=[21/Apr/2015:15:46 -v a=[21/Apr/2015:16:46 '$4 > b && $4 & ...
- LeetCode_ 4 sum
Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = tar ...
- OpenRisc-47-or1200的WB模块分析
引言 “善妖善老,善始善终”,说的是无论什么事情要从有头有尾,别三分钟热度. 对于or1200的流水线来说,MA阶段是最后一个阶段,也是整条流水线的收尾阶段,负责战场的清扫工作.比如,把运算指令的运算 ...
- HDU_1429——胜利大逃亡续,十位二进制状态压缩,状态判重
Problem Description Ignatius再次被魔王抓走了(搞不懂他咋这么讨魔王喜欢)……这次魔王汲取了上次的教训,把Ignatius关在一个n*m的地牢里,并在地牢的某些地方安装了带锁 ...
- 使用Windows驱动的虚拟打印机,打印Excel表格无表格线问题解决(2)
测试: 经前天的测试,最终还是没有明显的定夺到底是驱动的问题,还是打印机的问题.但是按照可能性来排查,最明显的一点就是其他测试环境不变的情况下增加一张图片,就可以打印出表格线,我始终觉得这里是突破点, ...
- hdu4746:2013杭州网络赛I 莫比乌斯反演
题意: 有5000组询问,每组询问求有多少i,j满足i∈[1,n],j∈[1,m]且gcd(i,j)的质因子数目<=p. n,m<=500000 思路: 首先预处理出每个数的质因子数目分别 ...
- 《算法问题实战策略》-chaper7-穷举法
关于这一章节<算法实战策略>有一段概述问题,我认为对于编程人员来说非常有价值,故在这里进行如下的摘抄: 构想算法是很艰难的工作.相比大家都经历过,面对复杂的要求只是傻乎乎地盯着显示器,或者 ...
- Linux----硬连接和软连接
一,概念 在Linux的文件系统中,保存在磁盘分区中的文件不管是什么类型都给它分配一个编号称为索引节点号(Inode Index). 硬链接 多个文件名指向同一个索引节点(一个文件有多个副本) 允许一 ...