环境:SSH
- 异常:org.springframework.beans.Not WritablProperty Exception
- 报错:Bean Property ** is not writable or has an invalid setter method
- 分析:由异常可以初步断定为spring配置文件有问题,或者配置文件中有问题。
- 场景:以下为我写的代码,用红框标记出错误的地方:
1:在action中:
2:在spring-action.xml中:
由此可见set方法名和配置文件名property name不一致,导致出错。 - 改错:将setBranchService 改为setBranchQueryService。