<
!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
我的 hibernate.cfg.xml 文件中有这个。我在 Eclipse 工作区的 WEB-INF 文件夹中下载了 jars(来自http://www.javatpoint.com/src/hb/hibernatejar.zip)。它仍然说 hibernate.sourceforge.net 无法访问。我用 www.hibernate.org/dtd 替换了它,这也给出了同样的错误。请帮我解决这个问题。
映射文件中也有同样的问题。
在 DOCTYPE 中添加类路径后出错:
log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" org.hibernate.HibernateException: Could not parse configuration: hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1491)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1425)
at StoreData.main(StoreData.java:12)
Caused by: org.dom4j.DocumentException: unknown protocol: classpath Nested exception: unknown protocol: classpath
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1481)
... 2 more