0
votes

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)}

1
Can you post your spring xml or Configuration class?Madhusudana Reddy Sunnapu

1 Answers

0
votes

Without more information about your config or your class there are 2 possible solutions:

  1. Your not scanning the package containing the class
  2. What u @Autowired is not annotated with anything Spring knows like @Repositoy, @Service,@Component etc