org.springframework.beans.NotWritablePropertyException: Invalid property ''registerDAO'' of bean class [service.RegisterService]: Bean property ''registerDAO'' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
原因:
在service中,registerDAO没有set方法。注意set方法的名字,一定要和属性保持一致
如:
private SelfAppointDAO selfAppointDAO;
// 错误的set方法
public void setAppointDAO(SelfAppointDAO myAppointDAO) {
this.selfAppointDAO = myAppointDAO;
}
//正确的set方法
public void setSelfAppointDAO(SelfAppointDAO myAppointDAO) {
this.selfAppointDAO = myAppointDAO;
}
原因:
在service中,registerDAO没有set方法。注意set方法的名字,一定要和属性保持一致
如:
private SelfAppointDAO selfAppointDAO;
// 错误的set方法
public void setAppointDAO(SelfAppointDAO myAppointDAO) {
this.selfAppointDAO = myAppointDAO;
}
//正确的set方法
public void setSelfAppointDAO(SelfAppointDAO myAppointDAO) {
this.selfAppointDAO = myAppointDAO;
}