2016-02-21 2 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

вы можете оставить пружинный XML или Configuratio n класс? –

ответ

0

Без дополнительной информации о конфигурации или классе есть 2 возможных решения:

  1. Вы не сканируя пакет, содержащий класс
  2. Что у @Autowired не аннотированный с чем Spring знает, как @Repositoy, @Service, @Component и т.д.
Смежные вопросы