最近在看夏昕的《Spring 开发指南》,在spring配置config.xml里设置commandClass参数的问题...
好久没来了。这些天一直在看夏昕的《Spring 开发指南》,遇到了一个问题没解决呢。
在Config.xml里有一段代码如下:
<bean id="LoginAction" class="net.xiaxin.action.LoginAction">
<property name="commandClass">
<value>net.xiaxin.action.LoginInfo</value>
</property>
<property name="fail_view">
<value>loginfail</value>
</property>
<property name="success_view">
<value>main</value>
</property>
</bean>
在net.xiaxin.action.LoginAction里设置了两个private String属性:fail_view和success_view,并且都提供了相应的setter方法。
运行时报错如下:
DispatcherServlet - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'LoginAction' defined in ServletContext resource [/WEB-INF/Config.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'commandClass' of bean class [net.xiaxin.action.LoginAction]: Bean property 'commandClass' 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.NotWritablePropertyException: Invalid property 'commandClass' of bean class [net.xiaxin.action.LoginAction]: Bean property 'commandClass' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
oh, my god.
Context initialization failed,
NotWritablePropertyException,
Invalid property 'commandClass' of bean class
Who can help me? SOS!
- SSM(spring-springmvc-mybatis)整合开发xml配置文件内容springmvc-config.xml,application.xml,web.xml
- JPA+Spring下,applicationContext.xml中的entityManagerFactory中的class设置问题
- JPA+Spring下,applicationContext.xml中的entityManagerFactory中的class设置问题
- web.xml 配制加载spring上下文及 Spring context-param param-value classpath 配置加载问题
- struts1和spring进行整合的时候struts-config.xml文件的配置顺序问题
- Spring--ClassPathXmlApplicationContext后的参数问题
- Spring开发指南_夏昕 问题总结
- Spring配置iBatis多个SqlMapConfig.xml
- 开发框架:Spring XML配置十二个最佳实践
- QuickServer开发指南(8)- XML配置
- Spring配置iBatis多个SqlMapConfig.xml
- C# webconfig配置解决post 传递中文参数乱码问题
- Log4j 配置spring 的webAppRootKey参数问题
- spring开发指南(夏昕)--Spring 高级特性:Spring MVC中的异常处理
- 又碰到问题了...附spring事务的xml配置(转)
- Fedora 7 安装与配置指南(含安装、yum设置、字体美化、Nvidia驱动问题、beryl等)
- Hibernate中自动增长列的..hbm.xml 配置和数据库设置默认值问题
- SiteMesh:关于decorators.xml配置文件中路径设置的问题
- Ibatis之Eclipse开发插件——Ibator的安装及ibatorConfig.xml的配置