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

问题描述

配置文件<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"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></beans>报错信息: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) 问题补充:AngelAndAngel 写道

解决方案

你的属性换个名字,第二个字母不要大写,前面的单词小写。然后用工具自动生成get set
解决方案二:
你把 iQuestionInfodao换个名字 比如iquestionInfoDao,然后生成get set 方法。然后把spring的配置文件中也改成 iquestionInfoDao我确定是这样的问题。
解决方案三:
引用Invalid property 'iQuestionInfodao' of bean class [com.talkweb.analyseInfo.service.impl.IQuestionsInfoImpl]这个错明显就是说 iQuestionInfodao 找不到这个字段啊。你还是把你的代码贴一下吧
解决方案四:
晕你的 iQuestionInfodao这个首字母大小写和配置的不一样吧
解决方案五:
引用有的 贴出来瞧瞧。顺便把你的这个 bean 的定义贴出来瞧瞧
解决方案六:
没有iQuestionInfodao 这个属性可以,但是 setIQuestionInfodao() 这个方法必须得有
解决方案七:
你的 com.talkweb.analyseInfo.service.impl.IQuestionsInfoImpl 这个类里有没有 iQuestionInfodao 这个属性,如果有的话,还必须为它写一个 setter 方法,即public void setIQuestionInfodao(xxx xxx){xxxxx}
解决方案八:
questionsInfoservice 里面的IQuestionInfodao是否没有set get方法?

时间: 2024-09-15 06:20:55

求解:org.springframework.beans.factory.BeanCreationException的相关文章

跪求大神帮解决org.springframework.beans.factory.BeanCreationException: Error creating b

问题描述 org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'org.springframework.dao.annotation.PersistenceExceptionTranslationPostProcessor#0':Initializationofbeanfailed;nestedexceptionisorg.springframework.beans.factory.Be

javase-关于Myeclipse的错误org.springframework.beans.factory.BeanCreationException

问题描述 关于Myeclipse的错误org.springframework.beans.factory.BeanCreationException 严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListenerorg.springframework.beans.factory.BeanCreati

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

问题描述 dwr和spring整合时出的问题,请问有谁知道这是怎么回事呢? 具体代码如下: dwr.xml <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE dwr PUBLIC "-//GetAhead Limited//DTD Direct Web Remoting 2.0//EN" "http://getahead.org/dwr/dwr20.dtd">

spring hibernate-org.springframework.beans.factory.BeanCreationException

问题描述 org.springframework.beans.factory.BeanCreationException applicationContext.xml文件 <?xml version=""1.0"" encoding=""UTF-8""?> xmlns=""http://www.springframework.org/schema/beans"" xmlns:

急死人了,SSH整合报错,高手进来帮忙解决啊,org.springframework.beans.factory.BeanCreationException

问题描述 2010-11-13 12:37:39 org.apache.catalina.core.AprLifecycleListener init信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:InstalledMyEclipsebin;D:In

springmvc-org.springframework.beans.factory.BeanCreationException:

问题描述 org.springframework.beans.factory.BeanCreationException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userService' defined in class path resource [application.xml]: Error setting property values; nested

org.springframework.beans.factory.BeanCreationException: Error creating bean wit

问题描述 org.springframework.beans.factory.BeanCreationException:Errorcreatingbeanwithname'txEasyjwebProcessorAdvice':Cannotresolvereferencetobean'transactionManager'whilesettingbeanproperty'transactionManager';nestedexceptionisorg.springframework.beans.

ssh整合出错:org.springframework.beans.factory.BeanCreationException: Error creating

问题描述 applicationContent.xml配置<?xml version="1.0" encoding="UTF-8"?><beans xmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:context="http://w

ibatis和Spring整合抛org.springframework.beans.factory.BeanCreationException

问题描述 『spring2.5和Ibatis2整合』spring配置文件如下:<?xmlversion="1.0"encoding="UTF-8"?><beansxmlns="http://www.springframework.org/schema/beans"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xmlns:p="http://