- 完整报错提示信息: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. applicationContext.xml:
<bean name="blogDetailsActionBean" class="com.blog.action.BlogDetailsAction"> <property name="blogDetailsService" ref="blogDetailsServiceImpl" /> </bean>
2.BlogDetailsAction.java
BlogDetailsService blogDetailsService; public BlogDetailsService getBlogDetailsService() { return blogDetailsService; } public void setBlogDetailService(BlogDetailsService blogDetailsService) { this.blogDetailsService = blogDetailsService; }
一般来说这样就可以解决问题了,待。。。