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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

相关文档推荐

How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)