简体   繁体   English

在eclipse中,根元素类型“ hibernate-configuration”的文档类型声明必须以“>”结尾

[英]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.

相关问题 org.xml.sax.SAXParseException; 文档根元素“ session-factory”,必须与DOCTYPE根“ hibernate-configuration”匹配 - org.xml.sax.SAXParseException; Document root element “session-factory”, must match DOCTYPE root “hibernate-configuration” dbUnit dtd错误:元素类型“dataset”的声明必须以“&gt;”结尾 - dbUnit dtd error: The declaration for element type “dataset” must end with '>' 在HTML中,文档类型声明是一个元素吗? - In HTML, is the document type declaration an element? 文档根元素“配置”,必须与DOCTYPE根“ null”匹配 - Document root element “configuration”, must match DOCTYPE root “null” hive-site.xml:元素类型“configuration”必须由匹配的end-tag终止“ </configuration> ” - hive-site.xml: The element type “configuration” must be terminated by the matching end-tag “</configuration>” 无法解析配置:hibernate.cfg.xml:元素类型“ session-factory”必须由匹配的结束标记“ </session-factory> ” - Could not parse configuration: hibernate.cfg.xml: The element type “session-factory” must be terminated by the matching end-tag “</session-factory>” Eclipse:必须声明元素类型“ Context” - Eclipse : Element type “Context” must be declared XML 到 DTD 错误:文档类型声明必须格式正确 - XML to DTD error: the document type declaration must be well-formed 文档类型声明和名称空间 - Document type declaration and namespaces log4j:WARN文档根元素“log4j:configuration”,必须与DOCTYPE根“null”匹配 - log4j:WARN Document root element “log4j:configuration”, must match DOCTYPE root “null”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM