XML RPC为Android - 无法创建XML解析:org.xml.sax.SaxNotRecognizedException [英] XML RPC for android - Unable to create the XML parse: org.xml.sax.SaxNotRecognizedException

查看:719
本文介绍了XML RPC为Android - 无法创建XML解析:org.xml.sax.SaxNotRecognizedException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是完全<一href="http://stackoverflow.com/questions/6089432/xml-rpc-problem-in-java-unable-to-create-the-xml-parse-org-xml-sax-saxnotreco">this问题只回答不削减对我来说。

My question is exactly this question, only the answer doesn't cut it for me.

答案仅指向讨论。问题的根源有很明显是相同的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-问题描述的

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

推荐答案

一个可能的解决方法是prevent的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常见的jar。

Just comment them out, compile it and replace the original xmlrpc-common jar.

这篇关于XML RPC为Android - 无法创建XML解析:org.xml.sax.SaxNotRecognizedException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆