android 的 XML RPC - 无法创建 XML 解析:org.xml.sax.SaxNotRecognized

XML RPC for android - Unable to create the XML parse: org.xml.sax.SaxNotRecognizedException(android 的 XML RPC - 无法创建 XML 解析: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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Reliable implementation of PBKDF2-HMAC-SHA256 for JAVA(PBKDF2-HMAC-SHA256 for JAVA 的可靠实现)
Correct way to sign and verify signature using bouncycastle(使用 bouncycastle 签名和验证签名的正确方法)
Creating RSA Public Key From String(从字符串创建 RSA 公钥)
Why java.security.NoSuchProviderException No such provider: BC?(为什么 java.security.NoSuchProviderException 没有这样的提供者:BC?)
Generating X509 Certificate using Bouncy Castle Java(使用 Bouncy Castle Java 生成 X509 证书)
How can I get a PublicKey object from EC public key bytes?(如何从 EC 公钥字节中获取 PublicKey 对象?)