問題描述
我的問題正是 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的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!