解决SAXParseException: Premature end of file
2012-07-12 09:50
453 查看
解决SAXParseException: Premature end of file
我是用xmlrpcClient发送XML时出的这个错误
提示:org.xml.sax.SAXParseException: Premature end of file.
现象:用MiniSniffer抓包后发现,发出去的http标头,相比用其它工具正常发出的HTTP,少了个
Accept: */* 这个标头...返回的XML则没有了,成空了。。我想是因为缺少这个ACCEPT标头所致的。。
问题代码:config = new XmlRpcClientConfigImpl();
//ati 2012.7.12
config.setEnabledForExtensions(Boolean.TRUE);
解决:config.setEnabledForExtensions(false);
//EnabledForExtensions这个属性高为FALSE。。这样发出去的标头就有accept了。。。
我是用xmlrpcClient发送XML时出的这个错误
提示:org.xml.sax.SAXParseException: Premature end of file.
现象:用MiniSniffer抓包后发现,发出去的http标头,相比用其它工具正常发出的HTTP,少了个
Accept: */* 这个标头...返回的XML则没有了,成空了。。我想是因为缺少这个ACCEPT标头所致的。。
问题代码:config = new XmlRpcClientConfigImpl();
//ati 2012.7.12
config.setEnabledForExtensions(Boolean.TRUE);
解决:config.setEnabledForExtensions(false);
//EnabledForExtensions这个属性高为FALSE。。这样发出去的标头就有accept了。。。
相关文章推荐
- faultString: org.xml.sax.SAXParseException: Premature end of file问题解决方案
- org.xml.sax.SAXParseException: Premature end of file 错误
- org.xml.sax.SAXParseException: Premature end of file
- org.xml.sax.SAXParseException: Premature end of file
- java读取xml文件报“org.xml.sax.SAXParseException: Premature end of file
- java读取xml文件报“org.xml.sax.SAXParseException: Premature end of file”
- Android解决异常org.xml.sax.SAXParseException: Unexpected end of document
- Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
- "org.xml.sax.SAXParseException: The content of element type "class" must match" 异常解决
- dom4j解决Premature end of file
- 异常-----freemarker.core.ParseException: Unexpected end of file reached
- freemarker.core.ParseException: Unexpected end of file reached
- Error on line -1 of document : Premature end of file. Nested exception: Premature end of file.
- spring应用启动异常 org.xml.sax.SAXParseException; Premature end of file.
- org.dom4j.DocumentException: Error on line 1 of document : Premature end of file. Nested exception:
- freemarker.core.ParseException:Unexpected end of file reached
- freemarker.core.ParseException:Unexpected end of file reached
- bin/sh -c:line 1 Syntax Error:unexpected end of file的解决方法
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- PHP错误Parse error: syntax error, unexpected end of file in test.php on line 12解决方法