問(wèn)題描述
我的問(wèn)題正是 this 問(wèn)題,只有答案對(duì)我沒(méi)有幫助.
My question is exactly this question, only the answer doesn't cut it for me.
答案只是指向this 討論.問(wèn)題的根源顯然與鏈接的 SO 問(wèn)題相同,但我看不出如何將線程末尾提到的解決方法應(yīng)用于我的問(wèn)題.
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.
所以問(wèn)題是:在 XML-RPC 案例中,我該如何避免這個(gè)錯(cuò)誤 - 鏈接的 SO-question 中描述的那個(gè)錯(cuò)誤
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
推薦答案
一個(gè)可能的解決方法是阻止 apache xml-rpc 設(shè)置這些功能.由于這些設(shè)置無(wú)論如何都不受支持,所以這應(yīng)該不是問(wèn)題(對(duì)我來(lái)說(shuō)很好).
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
}
只需將它們注釋掉,編譯并替換原來(lái)的 xmlrpc-common jar.
Just comment them out, compile it and replace the original xmlrpc-common jar.
這篇關(guān)于android 的 XML RPC - 無(wú)法創(chuàng)建 XML 解析:org.xml.sax.SaxNotRecognizedException的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!