[Classpath]: Could not parse configuration: ……\hibernate.cfg.xml

這裏寫圖片描述
解決方法:
將hibernate.cfg.xml 的開頭改爲:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
        "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">

或者先將hibernate-configuration-3.0.dtd下載到本地,然後使用本地驗證,這樣即使不聯網也不會出問題。

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration SYSTEM
        "file:///E:/Download/Program/hibernate-configuration-3.0.dtd">
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章