org.apache.harmony.xml.ExpatParser $ ParseException:在第1行第0列:语法错误

时间:2015-06-23 00:47:17

标签: android xml parsing

我正在尝试使用Apache服务器运行我的应用程序,但尝试登录时会出现以下错误:

06-22 20:41:40.646  23626-23626/com.example.feastapp W/IInputConnectionWrapper﹕ beginBatchEdit on inactive InputConnection
06-22 20:41:40.646  23626-23626/com.example.feastapp W/IInputConnectionWrapper﹕ endBatchEdit on inactive InputConnection
06-22 20:41:42.711  23626-24033/com.example.feastapp W/System.err﹕ org.apache.harmony.xml.ExpatParser$ParseException: At line 1, column 0: syntax error
06-22 20:41:42.711  23626-24033/com.example.feastapp W/System.err﹕ at org.apache.harmony.xml.ExpatParser.finish(ExpatParser.java:545)
06-22 20:41:42.711  23626-24033/com.example.feastapp W/System.err﹕ at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:475)
06-22 20:41:42.711  23626-24033/com.example.feastapp W/System.err﹕ at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:316)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:279)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at javax.xml.parsers.SAXParser.parse(SAXParser.java:390)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at javax.xml.parsers.SAXParser.parse(SAXParser.java:187)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at com.example.infrastructure.serve.MessagingService.parseFriendInfo(MessagingService.java:592)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at com.example.infrastructure.serve.MessagingService.getFriendList(MessagingService.java:309)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at com.example.infrastructure.serve.MessagingService.authenticateUser(MessagingService.java:368)
06-22 20:41:42.716  23626-24033/com.example.feastapp W/System.err﹕ at com.example.feastapp.UserSessionManage.LoggingIn$2$1.run(LoggingIn.java:232)

这是MessagningService.java第一个错误位置:

private void parseFriendInfo(String xml) {
        try {
            SAXParser sp = SAXParserFactory.newInstance().newSAXParser();
            sp.parse(new ByteArrayInputStream(xml.getBytes()), new HandlerXML(
                    MessagingService.this));
        } catch (ParserConfigurationException e) {
            e.printStackTrace();
        } catch (SAXException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

在Android 5.0上运行时不会发生此错误...

我该如何做到这一点?

0 个答案:

没有答案