[Tomcat] classpath resource [hbm.xml] cannot be opened because it does not exist
2015-05-28 09:42
746 查看
SSH配置问题,错误很明显,就是hibernate的配置文件有问题,位置不对。查看applicationContext.xml文件,其初始配置如下(example):
explorer视图发现这个文件夹,里面也确实还有一个struts.xml和User.hbm.xml,我将hbm.xml的路径的第一条去掉之后,启动tomcat不再出现问题。如下:
<list> <value>./user.hbm.xml</value> <value>./User.hbm.xml</value></list>于是我去查找这个文件的位置,发现在做完hibernate reverse engineering之后,在/project/src/下自动生成了一个hbm.xml的hibernate配置文件,我把这个位置填上去还是有错误,试过好几种可能的位置,都错了。于是问度娘,古老师,发现大多人都纠结的位置这个文件是不是在/WEB-INF/classes下面,我查看了一下,发现那个位置根本没有这个文件夹。后来想起,我用的是package explorer视图,有可能这个文件夹被隐藏了,于是我打开Navigation
explorer视图发现这个文件夹,里面也确实还有一个struts.xml和User.hbm.xml,我将hbm.xml的路径的第一条去掉之后,启动tomcat不再出现问题。如下:
<list> <value>./User.hbm.xml</value></list>
相关文章推荐
- java.io.FileNotFoundException: class path resource [bean/test/User.hbm.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- 关于class path resource [applicationContext.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- class path resource [spring.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [beans.xml] cannot be opened because it does not exist 解决方法
- idea class path resource [applicationContext.xml] cannot be opened because it does not exist
- eclipse项目报错怎么解决class path resource [beans.xml] cannot be opened because it does not exist
- class path resource [applicationContext.xml] cannot be opened because it does not exist
- class path resource [spring/applicationContext.xml] cannot be opened because it does not exist
- java.io.FileNotFoundException: class path resource [META-INF/xfire/services.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist
- spring junit class path resource [ /com/config/spring-core.xml] cannot be opened because it does not exist
- IDEA中Spring配置错误:class path resource [.xml] cannot be opened because it does not exist