解決方法:
將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">