ERRORDefaultDispatcherErrorHandler:42 - Exception occurred during processingrequest: Unable to instantiate Action, userAction, defined for 'user_regist' in namespace'/'Error creating bean with name 'userAction' defined in class path resource[applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'userService' of bean class [com.cn.action.UserAction]:Bean property 'userService' is not writable or has an invalid setter method.Did you mean 'userServcie'?
错误DefaultDispatcherErrorHandler:42-异常处理请求期间发生:无法实例化行动,userAction,为“用户regist”名称空间定义' / '创建bean与错误的名字“userAction”中定义的类路径资源应用applicationContext.xml:错误设定属性值;org.springframework.beans嵌套异常。NotWritablePropertyException:无效的属性的userServicebean类[com.cn.action.UserAction]:bean属性“userService”不是可写或有一个无效的setter方法。你的意思是“userServcie”?
原因:
注入userService时,在UserAction类中的userService写错了
解决:
删去重新写,如下:
private UserService userService;
public voidsetUserService(UserService userService) {
this.userService = userService;
}