gpt4 book ai didi

xml - Grails 错误 : invalid XML character (Unicode: 0x5c)

转载 作者:行者123 更新时间:2023-12-02 13:58:03 24 4
gpt4 key购买 nike

我对这个问题做了一些研究,但似乎所有其他答案都包括更改响应发送给您的方式。我正在调用以 xml 字符串返回的第三方 Web 服务。当我在本地 Win7 机器上执行此操作时,效果很好。但是当我把它放到我们的服务器 Win Server 2003 上时,我得到这个错误返回:

Error 500: Executing action [vinlookup] of controller [AutoVehicleController] caused   exception: null
Servlet: grails
URI: /NonProfits/grails/autoVehicle/vinlookup.dispatch
Exception Message: An invalid XML character (Unicode: 0x5c) was found in the public identifier.
Caused by: An invalid XML character (Unicode: 0x5c) was found in the public identifier.
Class: AutoVehicleController
At Line: [172]
Code Snippet:
Stack Trace
org.xml.sax.SAXParseException: An invalid XML character (Unicode: 0x5c) was found in the public identifier.

at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)

at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)

at VinPowerService.decodeVin(VinPowerService.groovy:40)

at VinPowerService$$FastClassByCGLIB$$6f8d198b.invoke(<generated>)

at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)

at VinPowerService$$EnhancerByCGLIB$$f1db38bd.decodeVin(<generated>)

at VinPowerService$decodeVin.call(Unknown Source)

at AutoVehicleController$_closure7.doCall(AutoVehicleController.groovy:172)

at AutoVehicleController$_closure7.doCall(AutoVehicleController.groovy)

at java.lang.Thread.run(Thread.java:619)

最佳答案

该消息非常明确:

An invalid XML character (Unicode: 0x5c) was found in the public identifier.



“公共(public)标识符”是出现在 DOCTYPE 声明中关键字 PUBLIC 之后的字符串。公共(public)标识符中可以出现哪些字符是有规则的,并且不允许使用反斜杠。

你有一个选择。说服生成此标识符的人改过自新,或编写某种脚本来修复收到的错误 XML。不太可能有人关心公共(public)标识符的值是什么,因此您可能只需删除反斜杠而不会造成任何损害。

关于xml - Grails 错误 : invalid XML character (Unicode: 0x5c),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11688440/

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