字符引用“&#x10”是无效的XML字符

时间:2019-12-02 17:50:53

标签: java xml gradle xml-parsing jaxb

我已将项目从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

1 个答案:

答案 0 :(得分:0)

将所有出现的替换为正确的XML数字字符引用
(或者当然是
,十进制等效项)。
然后错误应该消失。