我已经使用 Maven Hibernate 创建了简单的项目,但是项目给了我以下错误:
Initial SessionFactory creation failed./resources/hibernate.cfg.xml not found
org.hibernate.HibernateException: /resources/hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)
at Code.CourseDaoImp.<clinit>(CourseDaoImp.java:16)
at Code.CourseServiceImp.processCourse(CourseServiceImp.java:10)
at Code.app.main(app.java:21)
Exception in thread "main" java.lang.ExceptionInInitializerError
at Code.CourseDaoImp.<clinit>(CourseDaoImp.java:22)
at Code.CourseServiceImp.processCourse(CourseServiceImp.java:10)
at Code.app.main(app.java:21)
Caused by: org.hibernate.HibernateException: /resources/hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:170)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1453)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1475)
at Code.CourseDaoImp.<clinit>(CourseDaoImp.java:16)
... 2 more