Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'auctionManager' defined in ServletContext resource [/WEB-INF/classes/applicationContext.xml]: Cannot resolve reference to bean 'auctionUserDao' while setting bean property 'userDao'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'auctionUserDao' is defined
Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'auctionUserDao' is defined----------------------------------
相关代码
org.qjkt.service.impl.AuctionManagerImpl
private AuctionUserDao userDao;
    private BidDao bidDao;
    private ItemDao itemDao;
    private KindDao kindDao;
    private StateDao stateDao;
    private MailSender mailSender;
    private SimpleMailMessage message;

public void setUserDao(AuctionUserDao userDao) {
this.userDao = userDao; 
} public void setBidDao(BidDao bidDao) {
this.bidDao = bidDao; 
} public void setItemDao(ItemDao itemDao) {
this.itemDao = itemDao; 
}
--------------------------------------------------------------
applicationContext.xml    <bean id="auctionManager" class="org.qjkt.service.impl.AuctionManagerImpl">
        <property name="userDao" ref="auctionUserDao"/>
        <property name="bidDao" ref="bidDao"/>
        <property name="itemDao" ref="itemDao"/>
        <property name="kindDao" ref="kindDao"/>
        <property name="stateDao" ref="stateDao"/>
<property name="mailSender" ref="mailSender"/>
<property name="message" ref="mailMessage"/>
    </bean>
------------------------------------------------
希望大家踊跃发言  谢谢大家了

解决方案 »

  1.   

    auctionUserDao在spring bean配置文件中没有定义,请检查<property name="userDao" ref="auctionUserDao"/> 中的auctionUserDao的定义。还有检查一下拼写,容易出的毛病。
      

  2.   


    看清楚了,哪里定义了?? 只看到了auctionManager的定义。你Spring配制文件里有这个??<bean id="auctionUserDao".....????
      

  3.   

    No bean named 'auctionUserDao' is defined 
    关键是这个
      

  4.   

    <property name="userDao" ref="auctionUserDao"/> 中的 “auctionUserDao”没有被定义
      

  5.   

    不好意思   我漏发了个daoContext.xml   谢谢大家了  大家说的都对~