XML RPC for android - Unable to create the XML parse: org.xml.sax.SaxNotRecognizedException(android 的 XML RPC - 无法创建 XML 解析:org.xml.sax.SaxNotRecognizedException)
问题描述
我的问题正是 this 问题,只有答案对我没有帮助.
My question is exactly this question, only the answer doesn't cut it for me.
答案只是指向this 讨论.问题的根源显然与链接的 SO 问题相同,但我看不出如何将线程末尾提到的解决方法应用于我的问题.
The answer simply points to this discussion. The root of the problem there is obviously the same as in the linked SO question, but I don't see how I can apply the workaround mentioned by the end of the thread to my problem.
所以问题是:在 XML-RPC 案例中,我该如何避免这个错误 - 链接的 SO-question 中描述的那个错误
So the question is: How do I go about to avoid this error in the XML-RPC case - the one described in the linked SO-question
推荐答案
一个可能的解决方法是阻止 apache xml-rpc 设置这些功能.由于这些设置无论如何都不受支持,所以这应该不是问题(对我来说很好).
A possible fix is to prevent apache xml-rpc from setting these features. As these settings are unsupported anyway it shouldn't be a problem (works fine for me).
在 3.1.3 版本中,您需要更改 org.apache.xmlrpc.util.SAXParsers 第 37-50 行:
In version 3.1.3 you need to change org.apache.xmlrpc.util.SAXParsers Lines 37-50:
try {
spf.setFeature("http://xml.org/sax/features/external-general-entities", false);
} catch (javax.xml.parsers.ParserConfigurationException e) {
// Ignore it
} catch (org.xml.sax.SAXException e) {
// Ignore it
}
try {
spf.setFeature("http://xml.org/sax/features/external-parameter-entities", false);
} catch (javax.xml.parsers.ParserConfigurationException e) {
// Ignore it
} catch (org.xml.sax.SAXException e) {
// Ignore it
}
只需将它们注释掉,编译并替换原来的 xmlrpc-common jar.
Just comment them out, compile it and replace the original xmlrpc-common jar.
这篇关于android 的 XML RPC - 无法创建 XML 解析:org.xml.sax.SaxNotRecognizedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:android 的 XML RPC - 无法创建 XML 解析:org.xml.sax.Sax


- 如何使 JFrame 背景和 JPanel 透明且仅显示图像 2022-01-01
- 在 Java 中,如何将 String 转换为 char 或将 char 转换 2022-01-01
- GC_FOR_ALLOC 是否更“严重"?在调查内存使用情况时? 2022-01-01
- 将 Java Swing 桌面应用程序国际化的最佳实践是什么? 2022-01-01
- Eclipse 的最佳 XML 编辑器 2022-01-01
- 未找到/usr/local/lib 中的库 2022-01-01
- 如何指定 CORS 的响应标头? 2022-01-01
- java.lang.IllegalStateException:Bean 名称“类别"的 BindingResult 和普通目标对象都不能用作请求属性 2022-01-01
- 转换 ldap 日期 2022-01-01
- 获取数字的最后一位 2022-01-01