spring bean配置问题

张晓起 2008-11-13 05:55:12
ERROR [web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name '/web/console/subratio/subratio' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'subratioBusiness' of bean class [com.medicare.struts.action.SubratioAction]: Bean property 'subratioBusiness' 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 'subratioBusiness' of bean class [com.medicare.struts.action.SubratioAction]: Bean property 'subratioBusiness' is not writable or has an invalid setter method: Does the parameter type of the setter match the return type of the getter?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:567)

这是出现的问题
spring配置文件
<bean name="/web/console/subratio/subratio"
class="com.medicare.struts.action.SubratioAction">
<property name="subratioBusiness">
<ref local="subratioBusiness" />
</property>
</bean>
<bean id="subratioBusiness"
class="com.medicare.businessimp.SubratioBussinessImplements">
<property name="s709DAO">
<ref local="s709DAO" />
</property>
</bean>
<bean id="s709DAO" class="com.medicare.daoimp.S709DAOImplements">
<property name="hibernateTemplate">
<ref local="hibernateTemplate"/>
</property>
</bean>

struts里
<action attribute="subratioForm"
input="/web/console/subratio/subratio.jsp" name="subratioForm"
path="/web/console/subratio/subratio" scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="show"
path="/web/console/subratio/show.jsp"/>
<forward name="modify"
path="/web/console/subratio/modify.jsp"/>
<forward name="redirect"
path="/web/console/subratio/redirect.jsp"/>
<forward name="export"
path="/web/console/subratio/export.jsp"/>
<forward name="targetA"
path="/web/console/subratio/targetA.jsp"/>
<forward name="targetB"
path="/web/console/subratio/targetB.jsp"/>
<forward name="targetC"
path="/web/console/subratio/targetC.jsp"/>
<forward name="targetD"
path="/web/console/subratio/targetD.jsp"/>
</action>

帮我看一下
...全文
115 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
mytimes_walker 2008-11-13
  • 打赏
  • 举报
回复
初始化上下文失败
你的Struts的Action在Spring配置里面必须跟path参数的值一样.
NickCheng 2008-11-13
  • 打赏
  • 举报
回复
http://tieba.baidu.com/f?kz=350697879 去看看吧!
tzb08 2008-11-13
  • 打赏
  • 举报
回复
SubratioBussinessImplements 这个发出来看看

81,091

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧