source is null for getProperty(null, "parentId")
2018-02-17 22:01
423 查看
其根本原因还是我们常见的:java.lang.NullPointerException只不过该异常被Mybatils封装了,就像Spring把常见的SqlException封装成org.springframework.dao.XXXException一样,解决方法如下:
1.第一种办法在实体类中把对象New出来public class Report{
private String reportId;
private String videoId;
private Video video=new Video();
} 2.在mybatis中的sql语句进行逐层判断
①. 错误的写法
②. 正确的写法
1.第一种办法在实体类中把对象New出来public class Report{
private String reportId;
private String videoId;
private Video video=new Video();
} 2.在mybatis中的sql语句进行逐层判断
①. 错误的写法
②. 正确的写法
相关文章推荐
- source is null for getProperty(null, "xxx")
- 解决异常ognl.OgnlException: source is null for getProperty(null, "token")
- Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "list")
- root cause org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "XXX")
- org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "mil_id")
- 错误记录(11): source is null for getProperty(null, "name")
- Struts2 设置List值时出错:ognl.OgnlException: source is null for getProperty(null, "0")
- ognl.OgnlException: source is null for getProperty(null, "0")
- Caused by: org.apache.ibatis.ognl.OgnlException: source is null for getProperty(null, "id")
- 对于Name属性没有get/set方法引起的:target is null for setProperty(null, "x", [Ljava.lang.String;@1a48515)异常
- source is null for getproperty
- Warning Error user.userId value userid 出现错误ognl.OgnlException: target is null for setProperty(null, "userid", [Ljava.lang.String;@19af9e98)
- target is null for setProperty(null, "x", [Ljava.lang.String;@b0c40e)错误异常
- ognl.OgnlException: target is null for setProperty(null, "offset", [Ljava.lang.String;@1e86eb7)
- target is null for setProperty(null, "x", [Ljava.lang.String;@b0c40e)错误异常
- ognl.OgnlException: target is null for setProperty(null, "XX", [Ljava.lang.String;@10f8ee4)解决
- ognl.OgnlException: target is null for setProperty(null, "description", [Ljava.lang.String;@12069f2
- ognl.OgnlException: target is null for setProperty(null, "name", [Ljava.lang.String;@f6
- ognl.OgnlException: target is null for setProperty(null, "y", [Ljava.lang.String;@1d57c7)
- ognl.OgnlException: target is null for setProperty(null, "newsid", [Ljava.lan