2016-02-21 48 views
0

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public edu.java.spring.dao.impl.StudentHibernateDaoImpl edu.java.spring.controller.StudentController.studentDAO; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentDao': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: public org.springframework.orm.hibernate3.LocalSessionFactoryBean edu.java.spring.dao.impl.StudentHibernateDaoImpl.sessionFactory; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type [org.springframework.orm.hibernate3.LocalSessionFactoryBean] 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)}我用彈簧4+冬眠4遇到以下錯誤:

+0

您可以發佈您的Spring XML或Configuratio n班? –

回答

0

沒有關於你的配置或您的類的更多信息有2個可能的解決方案:

  1. 你不掃描包含類的包
  2. 什麼ü@Autowired不與任何春註釋惺惺相惜@Repositoy@Service@Component