【发布时间】:2014-10-21 20:43:26
【问题描述】:
使用 JUnit 构建会话工厂时脚本出错。我也试过使用:
return new Configuration().configure("src/test/resources/META-INF/hibernate.cfg.xml").buildSessionFactory();
我一直在移动它,但每次运行它。测试方法找不到hibernate.cfg.xml。
特别是我也在使用 Maven2。
错误:
SessionFactory creation failed.org.hibernate.HibernateException: src/test/resources/META-INF/hibernate.cfg.xml not found
我的项目/工作区名称也是“test”,所以我也尝试了“test/src/test”。没用。
【问题讨论】:
标签: java eclipse hibernate junit