您的位置:首页 > 运维架构

Bean property 'interceptorDao' is not writable or has an invalid setter method. Did you mean 'interc

2017-02-23 14:52 776 查看
在spring注入类的时候、导致出现

 Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: 
Invalid property 'interceptorDao' of bean class [com.bonc.service.interceptor.impl.InterceptorServiceImpl]: 
Bean property 'interceptorDao' is not writable or has an invalid setter method. Did you mean 'interceptordDao'? 
报错的原因有以下几个:

1:bean id="interceptorDao" 首字母一定要小写;

2:上下对照看看是否名字一样;

3:service实现类里面是否声明了dao层接口、添加了get、set方法、如图



4:看看声明的接口名字是否和注入的id一致、不一样也会报错;

如果你采用其他依赖注入方法、可以参照着改、原理都是一样。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐