[英]The document type declaration for root element type “hibernate-configuration” must end with '>' in eclipse
the following is my hibernate.cfg.xml file 以下是我的hibernate.cfg.xml文件
<!DOCTYPE hibernate-configuration SYSTEM
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hbm2ddl.auto">update</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:xe</property>
<property name="connection.username">bala</property>
<property name="connection.password">bala</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<mapping resource="Products.hbm.xml" />
I got the error when changed 'PUBLIC' to SYSTEM. 将“ PUBLIC”更改为SYSTEM时出现错误。 and I am unable to run my web application if I turn off my internet connection 如果关闭互联网连接,我将无法运行Web应用程序
My question How to execute a Hibernate web program without the internet connection? 我的问题如何在没有Internet连接的情况下执行Hibernate Web程序?
If you need to change a kind of Document Type Definition, you should know, that for the SYSTEM one only a system identifier must be given, though PUBLIC needs a formal public identifier and then a system identifier. 如果您需要更改一种文档类型定义,则应该知道,尽管PUBLIC需要一个正式的公共标识符,然后才是一个系统标识符,但是对于SYSTEM一个,仅必须给出一个系统标识符。
So, in your case, you need to make it like: 因此,在您的情况下,您需要使其类似于:
<!DOCTYPE hibernate-configuration SYSTEM
"classpath://org/hibernate/hibernate-configuration-3.0.dtd">
In this case, dtd file will not be downloaded, but used a local one, which must be on your classpath. 在这种情况下,不会下载dtd文件,而是使用本地文件,该文件必须位于您的类路径中。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.