SSH框架 Bean property * is not writable or has an invalid setter method错误分析与解决方法

错误出现提示:

org.springframework.beans.NotWritablePropertyExcep tion:Bean property 'SysUserService' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?

错误分析 :

根据org.springframework.beans.NotWritablePropertyExcep tion 初步分析是spring配置文件中配置问题 或配置文件中某个地方写的不对。

出错地点(红色标注为为导致出错的地方):


   SysUserDao " ref="SysUserDao">

而 java类中我写set方法中是这么写的

public class SysUserService {
private SysUserDao sysuserdao;

public void setSysuserdao(SysUserDao sysuserdao ) {
      this.sysuserdao = sysuserdao;
      }
}

set 中的属性sysuserdao 和 property name="SysUserDao " 写的不一致


解决方法:


   sysuserdao " ref="SysUserDao">

sysuserdao " ref="SysUserDao">修改成和set一致 即可。

你可能感兴趣的:(SSH框架 Bean property * is not writable or has an invalid setter method错误分析与解决方法)