org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'searchController': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: com.jlcindia.spring.service.StudentService com.jlcindia.mvc.SearchController.studentService; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'studentService': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private com.jlcindia.spring.dao.StudentDAO com.jlcindia.spring.service.StudentServiceImpl.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: org.springframework.orm.hibernate3.HibernateTemplate com.jlcindia.spring.dao.HibernateStudentDAO.htemp; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'rishi' defined in ServletContext resource [/WEB-INF/jlcindia-servlet.xml]: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Property 'sessionFactory' is required.
2 Answers
The last sentence tells you what is not working:
nested exception is java.lang.IllegalArgumentException: Property 'sessionFactory' is required.
It means that in the bean prior, which appears to be one 'rashi', you did not set the sessionFactory property.
Also, just to note, when you paste code/logs into the text box, you can select it and click the little {} button to mark it as "code". It also helps to give some description of the situation, and maybe some code.
what you missing here you need to create session factory bean in your xml file you can google it how we can create session factory.
Session factory will help you to create connections with database You can find many tutorials on them , Once you integreate session factory in your project just start using session factory to create dbconnections with session factory using hibernate template .
Thanks, himanshu