Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/hibernate/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/spring-mvc/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Hibernate 冬眠+;Spring Mvc集成_Hibernate_Spring Mvc - Fatal编程技术网

Hibernate 冬眠+;Spring Mvc集成

Hibernate 冬眠+;Spring Mvc集成,hibernate,spring-mvc,Hibernate,Spring Mvc,org.springframework.beans.factory.BeanCreationException:创建名为“searchController”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.beancreatitionException:无法自动连接字段:com.jlcindia.spring.service.StudentService com.jlcindia.mvc.SearchController.S

org.springframework.beans.factory.BeanCreationException:创建名为“searchController”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.beancreatitionException:无法自动连接字段:com.jlcindia.spring.service.StudentService com.jlcindia.mvc.SearchController.StudentService;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“studentService”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.beancreatitionException:无法自动关联字段:private com.jlcindia.spring.dao.StudentDAO com.jlcindia.spring.service.studentserviceinmpl.StudentDAO;嵌套异常为org.springframework.beans.factory.BeanCreationException:创建名为“studentDAO”的bean时出错:自动连线依赖项的注入失败;嵌套异常为org.springframework.beans.factory.beancreatitionException:无法自动连接字段:org.springframework.orm.hibernate3.HibernateTemplate com.jlcindia.spring.dao.HibernateStudentDAO.htemp;嵌套异常为org.springframework.beans.factory.BeanCreationException:使用ServletContext资源[/WEB-INF/jlcindia servlet.xml]中定义的名称“rishi”创建bean时出错:调用init方法失败;嵌套异常为java.lang.IllegalArgumentException:需要属性“sessionFactory”

最后一句告诉你什么不起作用:

nested exception is java.lang.IllegalArgumentException: Property 'sessionFactory' is required.
这意味着在BeanPrevior中,似乎是一个“rashi”,您没有设置sessionFactory属性


另外,请注意,当您将代码/日志粘贴到文本框中时,您可以选择它并单击小{}按钮将其标记为“代码”。这也有助于给出一些情况的描述,也许还有一些代码。

这里缺少什么您需要在xml文件中创建会话工厂bean您可以用谷歌搜索它我们如何创建会话工厂

会话工厂将帮助您创建与数据库的连接您可以找到许多关于它们的教程,一旦您在项目中集成创建会话工厂,只需开始使用会话工厂使用hibernate模板创建与会话工厂的数据库连接

谢谢,
himanshu

发布一些代码,我可以帮助某人回答您的问题。