firhmily 2011-09-01 16:29
浏览 336
已采纳

求解:org.springframework.beans.factory.BeanCreationException

配置文件
[code="java"]
<?xml version="1.0" encoding="UTF-8"?>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

<!-- Session公共类 -->
<bean id="sessionCookie" class="com.talkweb.ei.common.SessionCookie"
    scope="prototype">
    <property name="iQuestionInfodao" ref="questionInfoDaoImpl" />
</bean>
<bean id="questionInfoDaoImpl" class="com.talkweb.analyseInfo.biz.dao.impl.QuestionsInfoDaoImpl">
    <property name="sqlMapClient" ref="sqlMapClient"></property>
</bean>
<bean id="questionsInfoservice" class="com.talkweb.analyseInfo.service.impl.IQuestionsInfoImpl">
    <property name="iQuestionInfodao">
        <ref bean="questionInfoDaoImpl" />
    </property>
</bean>

<bean id="proxyQuestionsInfoService" parent="proxyBean">
    <property name="target">
        <ref bean="questionsInfoservice" />
    </property>
</bean>

<bean name="/QuestionInfo"
    class="com.talkweb.analyseInfo.web.struts.action.QuestionsInfoAction">
        <property name="questionInfo">
        <ref bean="proxyQuestionsInfoService"/>
    </property>
</bean>


[/code]

报错信息:
[code="java"]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'questionsInfoservice' defined in ServletContext resource [/WEB-INF/applicationContext-questionsinfo.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'iQuestionInfodao' of bean class [com.talkweb.analyseInfo.service.impl.IQuestionsInfoImpl]: Bean property 'iQuestionInfodao' is not writable or has an invalid setter method. Did you mean 'IQuestionInfodao'?
Caused by:
org.springframework.beans.NotWritablePropertyException: Invalid property 'iQuestionInfodao' of bean class [com.talkweb.analyseInfo.service.impl.IQuestionsInfoImpl]: Bean property 'iQuestionInfodao' is not writable or has an invalid setter method. Did you mean 'IQuestionInfodao'?
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:747)
at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:604)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValue(AbstractPropertyAccessor.java:49)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:74)
at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:57)
at org.springframework.beans.factory.support.AbstractBeanFactory.applyPropertyValues(AbstractBeanFactory.java:852)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1054)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:843)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:254)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:144)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:163)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:241)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Thread.java:619)

[/code]

  • 写回答

8条回答 默认 最新

  • AngelAndAngel 2011-09-01 16:54
    关注

    你的属性换个名字,第二个字母不要大写,前面的单词小写。然后用工具自动生成get set

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(7条)

报告相同问题?

悬赏问题

  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错
  • ¥15 webapi 发布到iis后无法访问
  • ¥15 初学者如何快速上手学习stm32?
  • ¥15 如何自动更换布娃娃图片上的衣服
  • ¥15 心理学eprime编程
  • ¥15 arduino esp8266开发
  • ¥15 stm32单片机通过485发送命令给驱动器控制电机转动,同样的代码f103可以控制电机转动,换到f407不能动了,但是用串口助手调试407显示发送的命令都是正确的,卡了好久了这是发送规则
  • ¥15 stm32f103c8t6最小系统板+2.8寸TFTLCD板子