SSH框架錯誤:ERROR ContextLoader:220 - Context initialization failed
SSH框架錯誤:ERROR ContextLoader:220 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'yonyou.ac.pdaserver.dao.imp.TbUserDaoImpl': Injection of resource dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in class path resource [beans.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [beans.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'dataSource' is defined
at org.springframework.context.annotation.CommonAnnotationBeanPostProcessor.postProcessPropertyValues(CommonAnnotationBeanPostProcessor.java:300)
applicationContext.xml檔案裡面的bean 的id寫成name屬性了,把所有bean name屬性改成id.