我嘗試在 java 16 中運行 hibernate 5.6.0,并且我正在使用 Intellij 2021.2 為 Apple silicon 進行編程。當我運行它時,我收到此錯誤:
log4j:WARN No appenders could be found for logger (org.jboss.logging).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.internal.util.config.ConfigurationException: Could not locate cfg.xml resource [hibernate.cfg.xml]
at org.hibernate.boot.cfgxml.internal.ConfigLoader.loadConfigXmlResource(ConfigLoader.java:53)
at org.hibernate.boot.registry.StandardServiceRegistryBuilder.configure(StandardServiceRegistryBuilder.java:254)
at org.hibernate.cfg.Configuration.configure(Configuration.java:260)
at mcrpg.mmorpg.Hibernate.start(Hibernate.java:11)
at mcrpg.mmorpg.Start.main(Start.java:7)
我的 hibernate.cfg.xml 位于源根目錄中:源樹
uj5u.com熱心網友回復:
始終將資源檔案包含在單獨的資源目錄中。默認情況下,Maven(以及 IDE)不會從源目錄復制資源檔案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/363263.html
標籤:爪哇 休眠 智能理念 休眠文件.cfg.xml
上一篇:SpringBoot多對一關系
