gpt4 book ai didi

java - Hibernate 5.4.x 由 : org. hibernate.boot.MappingException 引起:访问 stax 流时出错:origin(null)

转载 作者:行者123 更新时间:2023-12-02 09:44:09 26 4
gpt4 key购买 nike

我使用 hibernate 5.4.1。一切正常,2019 年 6 月 28 日无法启动服务。

Caused by: org.hibernate.boot.InvalidMappingException: Could not parse mapping document: null (INPUT_STREAM)
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:46)
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:38)
at org.hibernate.boot.spi.XmlMappingBinderAccess.bind(XmlMappingBinderAccess.java:94)
at org.hibernate.boot.MetadataSources.addInputStream(MetadataSources.java:382)
at org.hibernate.cfg.Configuration.addInputStream(Configuration.java:475)
at org.springframework.orm.hibernate5.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:508)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1804)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1741)
... 68 more
Caused by: org.hibernate.boot.MappingException: Error accessing stax stream : origin(null)
at org.hibernate.boot.jaxb.internal.AbstractBinder.seekRootElementStartEvent(AbstractBinder.java:141)
at org.hibernate.boot.jaxb.internal.AbstractBinder.doBind(AbstractBinder.java:101)
at org.hibernate.boot.jaxb.internal.AbstractBinder.bind(AbstractBinder.java:57)
at org.hibernate.boot.jaxb.internal.InputStreamXmlSource.doBind(InputStreamXmlSource.java:43)
... 75 more
Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,2]
Message: The markup declarations contained or pointed to by the document type declaration must be well-formed.
at com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(XMLStreamReaderImpl.java:601)
at com.sun.xml.internal.stream.XMLEventReaderImpl.peek(XMLEventReaderImpl.java:276)
at javax.xml.stream.util.EventReaderDelegate.peek(EventReaderDelegate.java:104)
at org.hibernate.boot.jaxb.internal.stax.BufferedXMLEventReader.peek(BufferedXMLEventReader.java:96)
at org.hibernate.boot.jaxb.internal.AbstractBinder.seekRootElementStartEvent(AbstractBinder.java:137)
... 78 more

最佳答案

终于我找到了根本原因。 hibernate 更新 dtd file 2019 年 6 月 27 日。似乎更新的文件 hibernate-mapping.dtd 与之前的版本不具有可比性。

在我的 hibernate 实体映射 *.hbm.xml 使用之前:

"http://hibernate.org/dtd/hibernate-mapping.dtd">

修复后,更改为以下内容,即可运行:

"https://hibernate.org/dtd/hibernate-mapping-3.0.dtd">

关于java - Hibernate 5.4.x 由 : org. hibernate.boot.MappingException 引起:访问 stax 流时出错:origin(null),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56800936/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com