JavaWeb项目启动报错:org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in file [E:\tomcat7.0\apache-tomcat-7.0.106\webapps\SSH_Project_war\WEB-INF\classes\spring\applicationContext.xml]: Invocation of init method failed; nested exception is java.io.FileNotFoundException: Could not open ServletContext resource [/spring/User.hbm.xml]
错误中的关键信息
Error creating bean with name 'sessionFactory'
Could not open ServletContext resource
[/spring/User.hbm.xml]
根据关键信息我们可以得知,项目启动失败是因为在spring中创建名为"sessionFactory"的bean时发生错误,错误的原因是无法打开实体类映射文件
文件的路径是正确的,但就是提示无法打开文件