Guestinfo.hbm(1)The markup declarations contained or pointed to by the document type declaration must be well-formed

时间:2022-06-24 10:07:12

今天启动ssh项目是居然报错了,还提示要联网启动,看了看错误信息发现,肯定是Hibernate映射文件的声明头出错了,仔细一下:

hbm.xml中的dtd头直接是连接www.hibernate.org的,而不是sourceforge的,使用过HIbernate的同仁都应该知道,一般你下载Hibernate是从sourceforge上下载的,出错hbm.xml具体配置如下:

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

正确配置是将上述蓝底红字改为:http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

附加:出错信息

08:12:39,591 ERROR [org.hibernate.util.XMLHelper] (MSC service thread 1-6) Error parsing XML: C:\Java\jboss-as-7.1.1.Final\standalone\deployments\qsmes.war\WEB-INF\classes\com\njutcm\qsmes\Domain\hbm\Guestinfo.hbm.xml(1) The markup declarations contained or pointed to by the document type declaration must be well-formed.
08:12:39,607 ERROR [org.springframework.web.context.ContextLoader] (MSC service thread 1-6) Context initialization failed: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Java\jboss-as-7.1.1.Final\standalone\deployments\qsmes.war\WEB-INF\classes\com\njutcm\qsmes\Domain\hbm\Guestinfo.hbm.xml
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:591) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Java\jboss-as-7.1.1.Final\standalone\deployments\qsmes.war\WEB-INF\classes\com\njutcm\qsmes\Domain\hbm\Guestinfo.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:325) [hibernate3.jar:3.2.6.ga]
at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:668) [hibernate3.jar:3.2.6.ga]
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:710) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
... 20 more
Caused by: org.dom4j.DocumentException: Error on line 1 of document http://10.10.0.248 : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482) [dom4j-1.6.1.jar:1.6.1]
at org.dom4j.io.SAXReader.read(SAXReader.java:264) [dom4j-1.6.1.jar:1.6.1]
at org.hibernate.cfg.Configuration.addFile(Configuration.java:311) [hibernate3.jar:3.2.6.ga]
... 25 more 08:12:39,639 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/qsmes]] (MSC service thread 1-6) Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in class path resource [applicationContext.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Java\jboss-as-7.1.1.Final\standalone\deployments\qsmes.war\WEB-INF\classes\com\njutcm\qsmes\Domain\hbm\Guestinfo.hbm.xml
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1455) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:519) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:456) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:294) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:225) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:291) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:193) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:591) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:918) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:469) [org.springframework.context-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:111) [org.springframework.web-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]
at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]
Caused by: org.hibernate.InvalidMappingException: Could not parse mapping document from file C:\Java\jboss-as-7.1.1.Final\standalone\deployments\qsmes.war\WEB-INF\classes\com\njutcm\qsmes\Domain\hbm\Guestinfo.hbm.xml
at org.hibernate.cfg.Configuration.addFile(Configuration.java:325) [hibernate3.jar:3.2.6.ga]
at org.hibernate.cfg.Configuration.addDirectory(Configuration.java:668) [hibernate3.jar:3.2.6.ga]
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:710) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:188) [org.springframework.orm-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1514) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1452) [org.springframework.beans-3.1.2.RELEASE.jar:3.1.2.RELEASE]
... 20 more
Caused by: org.dom4j.DocumentException: Error on line 1 of document http://10.10.0.248 : The markup declarations contained or pointed to by the document type declaration must be well-formed. Nested exception: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at org.dom4j.io.SAXReader.read(SAXReader.java:482) [dom4j-1.6.1.jar:1.6.1]
at org.dom4j.io.SAXReader.read(SAXReader.java:264) [dom4j-1.6.1.jar:1.6.1]
at org.hibernate.cfg.Configuration.addFile(Configuration.java:311) [hibernate3.jar:3.2.6.ga]

Guestinfo.hbm(1)The markup declarations contained or pointed to by the document type declaration must be well-formed的更多相关文章

  1. xml报错&lpar;dtd&rpar;&colon;The markup declarations contained or pointed to by the document type declaration must be well-formed

    文件后缀为.xml里如下一行报错“The markup declarations contained or pointed to by the document type declaration mu ...

  2. XML内部DTD约束 Day24

    <?xml version="1.0" encoding="UTF-8"?> <!-- 内部DTD --> <!-- XML:ex ...

  3. C&plus;&plus;银行储蓄程序代码

    */ * Copyright (c) 2016,烟台大学计算机与控制工程学院 * All rights reserved. * 文件名:text.cpp * 作者:常轩 * 微信公众号:Worldhe ...

  4. W3C词汇和术语表

    以A字母开头的词汇 英文 中文 abstract module 抽象模组 access 访问.存取 access control 存取控制 access control information 存取控 ...

  5. Using TXMLDocument&comma; Working with XML Nodes

    Using TXMLDocument The starting point for working with an XML document is the Xml.XMLDoc.TXMLDocumen ...

  6. 初探XML

    1.XML是什么? XML 指可扩展标记语言(EXtensible Markup Language) XML 是一种标记语言,很类似 HTML XML 的设计宗旨是传输数据,而非显示数据 XML 标签 ...

  7. Activating Browser Modes with Doctype

    原文地址:https://hsivonen.fi/doctype/ In order to deal both with content written according to Web standa ...

  8. chenxi的html学习笔记

    0.本文主体源自:http://www.cnblogs.com/coco1s/p/4034937.html,有兴趣的可以直接去那里看,也可以看看我整理加拓展的.1.浏览器内核: 1.ie:triden ...

  9. 前端必会html知识整理

    1.浏览器内核:         1.ie:trident(三叉戟)内核         2.firefox:gecko(壁虎)内核         3.safari:webkit(浏览器核心)内核 ...

随机推荐

  1. 自定义CoordinatorLayout Behavior 隐藏Footer View

    在用新的控件中,我们可以用Toolbar与CoordinatorLayout实现 向上滚动隐藏的效果,可是官方并没有找到向上隐藏底部导航的功能,有一些第三方的框架实现了. 在Android M,Coo ...

  2. CSS3中&colon;nth-child和&colon;nth-of-type的区别深入理解

    关于:nth-child和:nth-of-type的区别之前一直没太注意.最近打算深入了解一些CSS3,才发现里面其实暗藏玄机. :nth-child可以选择父元素下的字元素,:nth-of-type ...

  3. OC拓展&lpar;category&rpar;

    1. 扩展类的功能Category提供了一种比继承(inheritance)更为简洁的方法来对class进行扩展,我们可以为任何已经存在的class添加方法(不包括数据成员)却不需要访问该class的 ...

  4. chk cloud

  5. http缓存&lpar;http caching&rpar;

    通过使用缓存web网站和web应用的性能能够得到显著的提升.Web caches能够减小延迟和网络流量,从而缩短展示资源所花费的时间. 在http中控制缓存行为的首部字段是Cache-Control, ...

  6. Spring Boot分布式系统实践【1】-架构设计

    前言 [第一次尝试去写一个系列,肯定会有想不到的地方,欢迎大家留言指正] 本系列将介绍如果从零构建一套分布式系统.同时也是对自己过去工作的一个梳理过程. 本文先整理出构建系统的主要技术选型,以及技术框 ...

  7. &lbrack;转&rsqb; iOS9系统自带字体

    Family: Thonburi Font: Thonburi-Bold Font: Thonburi Font: Thonburi-Light 1 2 3 4 Family: Khmer Sanga ...

  8. CMake can't find GLEW

      Q: I'm on Windows and there is a FindGLEW.cmake file in my CMake modules folder, presumably put th ...

  9. windows安装mycat(转)

    http://blog.csdn.net/sc9018181134/article/details/53063798 1.先到github上下载mycat 2.下载完成后,解压.应该是这样一个样子 3 ...

  10. POJ3104 Drying 2017-05-09 23&colon;33 41人阅读 评论&lpar;0&rpar; 收藏

    Drying Time Limit: 2000MS   Memory Limit: 65536K Total Submissions: 15604   Accepted: 3976 Descripti ...