Tore Rudberg
Tore Rudberg

Reputation: 1624

XML RPC for android - Unable to create the XML parse: org.xml.sax.SaxNotRecognizedException

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

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.

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

Upvotes: 3

Views: 761

Answers (1)

Steohan
Steohan

Reputation: 526

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).

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
    }

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

Upvotes: 1

Related Questions