我对这个问题做了一点研究,但似乎所有其他答案都包括更改响应发送给您的方式。我正在调用第三方web服务,它返回一个xml字符串。当我在我的本地Win7机器上做什么时,情况就好了。但是,当我把它拿出来给我们的服务器,运Server 2003中,我得到这个错误的回报:Grails错误:无效的XML字符(Unicode:0x5c)
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)
你不说你是如何调用webservice,或者显示任何代码引发这个错误,或者说你正在使用哪个版本的Grails和相关插件......这可能有用吗? – 2012-07-27 15:14:59