gpt4 book ai didi

java - 字符引用 ""是无效的 XML 字符

转载 作者:行者123 更新时间:2023-12-01 19:44:16 37 4
gpt4 key购买 nike

我已将项目从 java-8 迁移到 java-9,但迁移后我在某些正在运行的作业中遇到 xml 解析错误。

该项目是一个 gradle 项目,我在 build.gradle 中添加了必要的更改以添加 jaxb 依赖项。

下面是我的 build.gradle 依赖项:

dependencies {
compile group: 'org.codehaus.groovy', name: 'groovy-all', version: '2.4.3'

compile "org.openjfx:javafx-base:11:win"
compile "org.openjfx:javafx-graphics:11:win"
compile "org.openjfx:javafx-controls:11:win"
compile "org.openjfx:javafx-fxml:11:win"



compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'

compile group: 'com.sun.xml.bind', name: 'jaxb-core', version: '2.3.0'
compile group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.3.0'
compile 'javax.annotation:javax.annotation-api:1.3.1'
compile 'com.sun.activation:javax.activation:1.2.0'
compile group: 'com.sun.xml.bind', name: 'jaxb-ri', version: '2.3.0', ext: 'pom'
compile group: 'javax.xml.ws', name: 'jaxws-api', version: '2.3.0'

testCompile group: 'junit', name: 'junit', version: "${junitVersion}"
testCompile group: 'org.springframework', name: 'spring-test', version: "${springVersion}"
testCompile group: 'org.mockito', name: 'mockito-core', version: '1.9.5'
}


Below is the error that I'm facing(Occurs randomly but too often):

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[1,379459]
Message: Character reference "&#x10" is an invalid XML character.
at java.xml/com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl.next(Unknown Source)
at java.xml/com.sun.xml.internal.stream.XMLEventReaderImpl.peek(Unknown Source)
at microsoft.exchange.webservices.data.core.EwsXmlReader.isEmptyElement(EwsXmlReader.java:1037)
at microsoft.exchange.webservices.data.core.EwsXmlReader.readElementValue(EwsXmlReader.java:358)
at microsoft.exchange.webservices.data.property.definition.TypedPropertyDefinition.loadPropertyValueFromXml(TypedPropertyDefinition.java:133)
at microsoft.exchange.webservices.data.property.definition.StringPropertyDefinition.loadPropertyValueFromXml(StringPropertyDefinition.java:34)
at microsoft.exchange.webservices.data.core.PropertyBag.loadFromXml(PropertyBag.java:510)
at microsoft.exchange.webservices.data.core.service.ServiceObject.loadFromXml(ServiceObject.java:298)
at microsoft.exchange.webservices.data.core.response.SyncResponse.readElementsFromXml(SyncResponse.java:158)
at microsoft.exchange.webservices.data.core.response.ServiceResponse.loadFromXml(ServiceResponse.java:133)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.parseResponse(MultiResponseServiceRequest.java:76)
at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.parseResponse(MultiResponseServiceRequest.java:44)
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.readResponse(ServiceRequestBase.java:433)
at microsoft.exchange.webservices.data.core.request.ServiceRequestBase.readResponse(ServiceRequestBase.java:401)
at microsoft.exchange.webservices.data.core.request.SimpleServiceRequestBase.internalExecute(SimpleServiceRequestBase.java:63)
... 23 common frames omitted

最佳答案

替换所有出现的 具有正确的 XML 数字字符引用 
 (或者,当然是 
 ,十进制等值)。
然后错误就会消失。

关于java - 字符引用 "&#x10"是无效的 XML 字符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59144238/

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