异常处理:Bean property 'XXX' is not writable or has an invalid setter method.
来源:互联网 发布:非凡软件下载 编辑:程序博客网 时间:2024/06/08 01:36
异常:Bean property 'XXX' 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.factory.BeanCreationException: Error creating bean with name 'cnkiNewInfoService': Injection of resource dependencies failed;
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'luceneJournalService' defined in file [D:\Workspaces\eclipse_luna\.metadata\.plugins\org.eclipse.wst.server.core\tmp3\wtpwebapps\sky\WEB-INF\classes\com\ourchem\data\spring\journal-spring.xml]: Error setting property values;
nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'indexWriterJournalCreator' of bean class [com.ourchem.data.lucene.impl.LuceneJournalServiceImpl]:Bean property 'indexWriterJournalCreator' is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
分析:
此异常一般出现在spring依赖注入时,如果你用set注入,在spring的XML配置文件中的property属性的name值一定要和你在java中的set方法里的变量一直。
具体举例,解决方法如下:
- 异常处理:Bean property 'XXX' is not writable or has an invalid setter method.
- Bean property 'xxx' is not writable or has an invalid setter method
- Bean property 'xxx' is not writable or has an invalid setter method
- Spring 配置文件报错:Bean property 'xxx' is not writable or has an invalid setter method
- Bean property 'xxx' is not writable or has an invalid setter method
- Bean property 'xxx' is not writable or has an invalid setter method
- JDK1.8部署 dubbo 出现异常:Bean property 'URIType' is not writable or has an invalid setter method
- Bean property 'loginDAO' is not writable or has an invalid setter method
- Bean property 'service' is not writable or has an invalid setter method. Did you mean 'serivce'?
- 错误信息:Bean property 'sessionFactory' is not writable or has an invalid setter method.
- Bean property 'annotatedClasses' is not writable or has an invalid setter method
- Bean property 'adminService' is not writable or has an invalid setter method
- Bean property XX' is not writable or has an invalid setter method
- spring中XML中Bean property 'dataSource' is not writable or has an invalid setter method.
- 错误信息:Bean property 'sessionFactory' is not writable or has an invalid setter method.
- Bean property 'manualPaperService' is not writable or has an invalid setter method. Did you mean 'ma
- Bean property 'addressService' is not writable or has an invalid setter method.
- 报错:Bean property 'jdbcTemplate' is not writable or has an invalid setter method
- javascript判断一个数是否是质数
- SpringAOP拦截Controller,Service实现日志管理(自定义注解的方式)
- 排序
- struct fb_bitfield
- Character 方法字符的操作
- 异常处理:Bean property 'XXX' is not writable or has an invalid setter method.
- 树上记忆化搜索(Crazy Bobo,HDU 5325)
- webrtc qm_select 简略注释
- express框架的理解
- mysql 将竖列的表格数据拼接成横向的数据,查询结果
- 关于欧拉函数的一个性质
- Windows下Nginx的启动、停止等命令
- Kotlin学习之-4.3.3 控制流
- 【重要更新】强大的文档管理工具包Aspose.Total 2017年中更新大合集