最近在看夏昕的《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!
- 最近在看夏昕的《Spring 开发指南》,在spring配置config.xml里设置commandClass参数的问题...
- JPA+Spring下,applicationContext.xml中的entityManagerFactory中的class设置问题
- JPA+Spring下,applicationContext.xml中的entityManagerFactory中的class设置问题
- Spring--ClassPathXmlApplicationContext后的参数问题
- SSM(spring-springmvc-mybatis)整合开发xml配置文件内容springmvc-config.xml,application.xml,web.xml
- struts1和spring进行整合的时候struts-config.xml文件的配置顺序问题
- Spring开发指南_夏昕 问题总结
- web.xml 配制加载spring上下文及 Spring context-param param-value classpath 配置加载问题
- spring 配置文件中datasource 从properties文件中获取mysql数据库连接参数遇到的问题
- Fedora 7 安装与配置指南(含安装、yum设置、字体美化、Nvidia驱动问题、beryl等)
- 又碰到问题了...附spring事务的xml配置
- 在 Spring.NET 中使用 PropertyPlaceholderConfigurer 设置配置参数
- Spring 总结XML配置的十二个最佳实践-Java基础-Java-编程开发
- C# webconfig配置解决post 传递中文参数乱码问题
- Spring配置iBatis多个SqlMapConfig.xml
- Spring配置iBatis多个SqlMapConfig.xml
- SiteMesh:关于decorators.xml配置文件中路径设置的问题
- Spring 配置问题还是代码问题?Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
- 又碰到问题了...附spring事务的xml配置(转)