记录:Spring和Hibernate整合的时出现 的异常信息
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'EmpTest.EmpTest': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.shuting.service.EmpService EmpTest.EmpTest.es; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [com.shuting.service.EmpService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true), @org.springframework.beans.factory.annotation.Qualifier(value=empService)}
原因:将ApplicationContext创建的对象赋值给另外一个类导致出现该异常
该异常出现原因有很多,本博客只记录自己所遇到的问题