ssh--service注入时出错:ERRORDefaultDispatcherErrorHandler:42

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;

      }
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值