org.hibernate.PropertyAccessException: Exception occurred inside getter of ******——【hibernate 日常错误】

En:org.hibernate.PropertyAccessException: Exception occurred inside getter of org.enva.pojo.Person.password

错误原因:Person 实体类中的password属性的setting/getting方法同password的类型不匹配  以下便是错误示例:【错误位置由红色标出】

package org.enva.pojo;

import java.util.Date;
/**
 * 持久化类设计
 * 注意:
 *     持久化类通常建议有一个持久化标识符(ID)
 *  持久化标识符通常建议使用 封装类(基本类型有默认值)
 *  持久化类通常建议手动给定一个无参构造器(因为有一些操作,是反射进行的)
 *  属性通常建议提供 getting/setting方法
 *  持久化类不能是final
 *  持久化类中如果使用了集合类型数据,只能用接口类型进行申明(List/Set/Map)
 *  List list=new ArrayList();
 * @author Administrator
 * @file Person.java
 * @date 2015年12月3日
 * @action
 */
public class Person {
    private Integer id;
    private String name;
    private Integer password;
    private Date birthday;
    public Person(){}
    public Person(String name, int password, Date birthday) {
        super();
        this.name = name;
        this.password = password;
        this.birthday = birthday;
    }
    @Override
    public String toString() {
        return "Person [id=" + id + ", name=" + name + ", password=" + password + ", birthday=" + birthday + "]";
    }
    public Integer getId() {
        return id;
    }
    public void setId(Integer id) {
        this.id = id;
    }
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public int getPassword() {
        return password;
    }
    public void setPassword(int password) {
        this.password = password;
    }

    public Date getBirthday() {
        return birthday;
    }
    public void setBirthday(Date birthday) {
        this.birthday = birthday;
    }
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
org.mvel2.PropertyAccessException: [Error: null pointer: xsetz.indexOf('.')] [Near : {... xsetz.indexOf('.') > 0 ....}] ^ [Line: 1, Column: 1] at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:450) at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.optimizeAccessor(ReflectiveAccessorOptimizer.java:163) at org.mvel2.optimizers.dynamic.DynamicOptimizer.optimizeAccessor(DynamicOptimizer.java:80) at org.mvel2.ast.ASTNode.optimize(ASTNode.java:159) at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:115) at org.mvel2.ast.BinaryOperation.getReducedValueAccelerated(BinaryOperation.java:125) at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85) at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123) at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119) at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:113) at org.mvel2.MVEL.executeExpression(MVEL.java:929) at com.creating.services.mdruleexecute.MdruleMain.lambda$runMdResult$0(MdruleMain.java:85) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at java.lang.Thread.run(Thread.java:748) Caused by: java.lang.NullPointerException: null at org.mvel2.optimizers.impl.refl.ReflectiveAccessorOptimizer.compileGetChain(ReflectiveAccessorOptimizer.java:383) ... 14 common frames omitted
最新发布
06-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值