org.springframework.beans.NotWritablePropertyException:Bean property 'xxxService' is not writable or has an invalid setter method.
- 完整报错提示信息:Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'blogDetailsService' of bean class [com.blog.action.BlogDetailsAction]: Bean property 'blogDetailsService' is not writable or has an invalid setter method. Did you mean 'blogDetailService'?
- 解决方案:
- 保证applicationContext.xml中注入的属性名称与com.blog.action.BlogDetailsAction中属性名称相同
1.1 applicationContext.xml:
<bean name="blogDetailsActionBean" class="com.blog.action.BlogDetailsAction">
<property name="blogDetailsService" ref="blogDetailsServiceImpl" />
</bean>
1.2 BlogDetailsAction.java
BlogDetailsService blogDetailsService;
public BlogDetailsService getBlogDetailsService() {
return blogDetailsService;
} public void setBlogDetailService(BlogDetailsService blogDetailsService) {
this.blogDetailsService = blogDetailsService;
}
注:一般来说这样就可以解决问题了,但我这里不知道为什么必须将blogDetailsService全部都改成blogDetailService才可以运行。
原因:修改的struts.xml未生效。重开工作空间解决。
org.springframework.beans.NotWritablePropertyException:Bean property 'xxxService' is not writable or has an invalid setter method.的更多相关文章
- 错误:Bean property 'sessionFactory' is not writable or has an invalid setter method.
Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sessionFactory' ...
- Bean property ‘mapperHelper’ is not writable or has an invalid setter method. Does the parameter type of the setter match the return type of the getter?
spring boot 报错: Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property ...
- Bean property '**DAO' is not writable or has an invalid setter method
ApplicationContext.xml中配置有问题,里面的bean的属性名称写错了. ApplicationContext.xml中写的是loginDAO,在java类里配置的bean却写成了l ...
- error: Bean property 'userDAO' is not writable or has an invalid setter method.
使用Spring属性注入的方式,没有在ServiceImpl中setDao,导致程序报错 public class AddressServiceImpl implements IAddressServ ...
- Bean property 'transactionManagerBeanName' is not writable or has an invalid set
[2017-02-07 11:38:48,458]-[localhost-startStop-1]-[org.springframework.beans.factory.support.Default ...
- dubbo-admin-2.5.3 运行报错: Bean property 'URIType' is not writable or has an invalid 解决方法
因为 jdk 是1.8的版本,和 dubbo-admin 存在兼容性问题.所以报错: Bean property 'URIType' is not writable or has an invalid ...
- Bean property XX' is not writable or has an invalid setter method
刚刚搞spring.property注入时遇到这个问题,百度一下.非常多人说是命名或者get set方法不一致的问题,可是这个我是知道的.写的时候也注意到这些.所以应该不是这个问题.以为是xml头写的 ...
- Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'URIType' of bean class [com.alibaba.citrus.service.uribroker.uri.GenericURIBroker]
linux中的JDK为JDK8,tomcat为tomcat8 加入dubbo.war包 启动报错! Caused by: org.springframework.beans.factory.BeanC ...
- Caused by: org.springframework.beans.NotWritablePropertyException
1.错误叙述性说明 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -h ...
随机推荐
- lombok的使用以及其中的坑
1.lombok踩坑与思考 https://www.cnblogs.com/heyonggang/p/8638374.html 2.Lombok介绍.使用方法和总结 https://www.cnblo ...
- SQL -------- WHERE子句与AND,OR和NOT运算符结合使用。
AND, OR and NOT 与 运算符中的且或非的意思相同 WHERE子句可以与AND,OR和NOT运算符结合使用. and 表示 查询的语句必须全部包含and 连接的两个或多个条件 or ...
- Elasticsearch Field Options Norms
Elasticsearch 定义字段时Norms选项的作用 本文介绍ElasticSearch中2种字段(text 和 keyword)的Norms参数作用. 创建ES索引时,一般指定2种配置信息:s ...
- NPOI Excel同一个单元格 多种字体
public static void CreateFont() { IWorkbook workbook = new HSSFWorkbook(); workbook.CreateSheet(&quo ...
- windows 10 配置Java 环境变量(5步骤)
前提:1.windows 10 系统(不是win8,也不是win7)2.安装JDK步骤 1. 打开 环境变量窗口右键 This PC(此电脑) -> Properties(属性) -> A ...
- python 排序 归并排序
算法思想 迭代法: 归并算法一共有两种思想,笼统的说,这两种思想的区别就在于一种不分割未排序的序列(直接将序列看为n个个数为1的子序列),这种称为---迭代法 直接从队头开始,两两合并为一个个数为2的 ...
- Java内功心法,创建型设计模式包括哪些
1. 单例(Singleton) Intent 确保一个类只有一个实例,并提供该实例的全局访问点. Class Diagram 使用一个私有构造函数.一个私有静态变量以及一个公有静态函数来实现. 私有 ...
- Java线程安全面试题,你真的了解吗?
多个线程不管以何种方式访问某个类,并且在主调代码中不需要进行同步,都能表现正确的行为. 线程安全有以下几种实现方式: 不可变 不可变(Immutable)的对象一定是线程安全的,不需要再采取任何的线程 ...
- ES6入门系列 ----- 对象的遍历
工作中遍历对象是家常便饭了,遍历数组的方法五花八门, 然而很多小伙伴是不是和我之前一样只会用for ...in.... 来遍历对象呢, 今天给大家介绍五种遍历对象属性的方法: 1, 最常用的for ...
- java--Date时间
Date: 表示特定的瞬间,精确到毫秒,通过方法设定自己所表示的时间,可以表示任意的时间 System.currentTimeMillis() :返回的当前系统时间, 1970-1-1 至今的毫秒数 ...