org.springframework.beans.NotReadablePropertyException:无效的属性[' aaaa']

时间:2017-10-30 03:39:34

标签: java spring spring-boot

获取:不可读的属性异常

POJO班级正在拥有该实体。

[ org.springframework.beans.NotReadablePropertyException: Invalid property 'email' of bean class [java.lang.String]: Bean property 'email' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
    at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyValue(AbstractNestablePropertyAccessor.java:633) ~[spring-beans-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.beans.AbstractNestablePropertyAccessor.getPropertyValue(AbstractNestablePropertyAccessor.java:624) ~[spring-beans-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.validation.AbstractPropertyBindingResult.getActualFieldValue(AbstractPropertyBindingResult.java:99) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.validation.AbstractBindingResult.getFieldValue(AbstractBindingResult.java:229) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.validation.ValidationUtils.rejectIfEmptyOrWhitespace(ValidationUtils.java:245) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at org.springframework.validation.ValidationUtils.rejectIfEmptyOrWhitespace(ValidationUtils.java:184) ~[spring-context-4.3.11.RELEASE.jar:4.3.11.RELEASE]
    at com.validator.UserModelValidator.validate(UserModelValidator.java:93) ~[classes/:na]]

POJO类:验证字段元素获取Not Readbale属性异常时:IN Pojo类访问说明符是公共的.. 获取:不可读属性异常

POJO班级正在拥有该实体。

public class UserModel {

public UserModel() {
    super();

}

/** Class logger */
private static final Logger logger = 
LoggerFactory.getLogger(UserModel.class);

private UUID uid;

String email;

private String name;

private long passwordLastUpdatedOn;

private int accountStatus;

private String language;

public UUID getUid() {
    return uid;
}

public void setUid(UUID uid) {
    this.uid = uid;
}

public String getEmail() {
    return email;
}

public void setEmail(String userEmail) {
    this.email = userEmail;
}

public String getName() {
    return name;
}

public void setName(String name) {
this.name = name;
}

0 个答案:

没有答案