hibernate配置文件问题

请叫我帅 2017-11-15 04:34:26
2017-11-15 16:21:59,497 ERROR [org.hibernate.util.XMLHelper] - Error parsing XML: XML InputStream(1) The markup declarations contained or pointed to by the document type declaration must be well-formed.
2017-11-15 16:21:59,501 WARN [org.springframework.web.context.support.XmlWebApplicationContext] - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'paymentOrderDetailDAO' defined in file [F:\workspace\caiww\out\artifacts\admin\WEB-INF\classes\spring\context-business-admin-user.xml]: Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'masterSessionFactory' defined in file [F:\workspace\caiww\out\artifacts\admin\WEB-INF\classes\spring\context-hibernate.xml]: Invocation of init method failed; nested exception is org.hibernate.InvalidMappingException: Could not parse mapping document from input stream
Caused by: org.dom4j.DocumentException: Error on line 1 of document http://hibernate.org/dtd/hibernate-mapping-3.0.dtd : 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)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:601)
... 34 more
...全文
71 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
请叫我帅 2017-11-15
  • 打赏
  • 举报
回复
我已经找到带来问题 是因为使用Hibernate Tools 4.3.1.Final自动生成的*.hbm.xml文件中,文档类型(DOCTYPE )有问题
怪人伽利略 2017-11-15
  • 打赏
  • 举报
回复
注解一下就可以了
  • 打赏
  • 举报
回复
可能你在写XML文件里面的配置有错误 ,不然你删除这个xml,重新来一次,或者用文本保存去掉头bom,放进去再试

67,513

社区成员

发帖
与我相关
我的任务
社区描述
J2EE只是Java企业应用。我们需要一个跨J2SE/WEB/EJB的微容器,保护我们的业务核心组件(中间件),以延续它的生命力,而不是依赖J2SE/J2EE版本。
社区管理员
  • Java EE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧