0
我正在開發一個小的Java應用程序來學習ORM。而且應用程序僅在默認包中運行。當我將它移動到其他包中時,它會顯示以下錯誤。我想知道我怎麼能打動我的文件(hibernate.cfg.xml中,Employee.hbm.xml,Employee.java,ManageEmployee.java)使用Java,Hibernate和mySql
**log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Failed to create sessionFactory object.org.hibernate.HibernateException: /hibernate.cfg.xml not found
Exception in thread "main" java.lang.ExceptionInInitializerError
at employ_hibe.ManageEmployee.main(ManageEmployee.java:27)
Caused by: org.hibernate.HibernateException: /hibernate.cfg.xml not found
at org.hibernate.util.ConfigHelper.getResourceAsStream(ConfigHelper.java:147)
at org.hibernate.cfg.Configuration.getConfigurationInputStream(Configuration.java:1402)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1424)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1411)
at employ_hibe.ManageEmployee.main(ManageEmployee.java:24)
Java Result: 1**
您是否嘗試過創建並添加'hibernate.cfg.xml'? –