/hibernate.cfg.xml not found
这不是提示你文件没找到吗,路径问题,你这个文件放在src根目录下了吗?
这不是提示你文件没找到吗,路径问题,你这个文件放在src根目录下了吗?
解决方案 »
- applicationContext.xml错误
- Tomcat的几个疑问
- 关于页面排序问题,涉及数据库
- 如何用JAVA实现动态创建一个文件夹名称为当前时间(如2007-03-20)的文件夹!谢谢
- 同样是一道面试题!!!请大家看看!
- 小弟想做一个论坛!!请教!!急急急!!
- 我也急..
- 一个简单问题,在 a.jsp中填写内容 在a_save.jsp中执行保存?
- stmt.stmt.executeUpdate(sql)的返回值是什么?
- 高分求救,JDBC错误java.lang.NullPointerException,在线等待(急),环境Tomcat5+MS Server2000+2003Server
- 蛋疼 ssh框架的h4中方言读取不了
- 关于Runtime.getRuntime().exec(cmd);问题,请求大神帮忙解决,昨天一晚上没搞出来
我没有src目录
默认是加载src下的。
Exception in thread "main" org.hibernate.HibernateException: /WEB-INF/hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1405)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1427)
at com.corona.web.action.SaveTrouble1Action.main(SaveTrouble1Action.java:354)
String path = Thread.currentThread().getContextClassLoader().getResource("").getPath();web-inf前面加上完整路径看看?
Configuration config=new Configuration().configure("/hibernate.cfg.xml");
Configuration config=new Configuration().configure("hibernate.cfg.xml");都还是找不到