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>
------------------------------------------------
希望大家踊跃发言 谢谢大家了
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>
------------------------------------------------
希望大家踊跃发言 谢谢大家了
解决方案 »
- struts2 和 spring 集成出现的一个怪问题,请各位大侠献计
- Spring Bean管理中自动绑定不成功,求教
- spring+struts+hibernate的小问题
- 跪求:基于struts+hibernate的购物网站源代码
- 用.do调用action,出现问题,求前辈指教
- webservice 连接数据库的问题。急!
- 关于图片加水印问题,怎么能够处理gif的图片?怎么都是生成jpg的啊
- 为什么在Jbuilder中没有WebLogic Server的配置文件weblogic.xml的图形界面配置呀?
- BigDecimal的用法
- html用什么后台框架比较好
- Java开发的快捷键
- 一个超级简单题,散分咯
看清楚了,哪里定义了?? 只看到了auctionManager的定义。你Spring配制文件里有这个??<bean id="auctionUserDao".....????
关键是这个