我對這個問題做了一點研究,但似乎所有其他答案都包括更改響應發送給您的方式。我正在調用第三方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