org.gjt.xpp.XmlPullParserException 错误解决
2014-02-19 22:55
573 查看
// 定义一个SringBuffer对象,用于接受参数 StringBuffer xmlBuffer = new StringBuffer(); String line = null; // 通过request获取获取输入流 BufferedReader reader = request.getReader(); // 一次读取请求输入流的数据 while ((line = reader.readLine()) != null) { xmlBuffer.append(line); } // 将从输入流中读取到的内容转换 成字符串 String xml = xmlBuffer.toString(); // 以Dom4J开始解析XML字符串 InputStream in = new ByteArrayInputStream(xml.getBytes()); Document xmlDoc = (Document)new XPPReader().read(new ByteArrayInputStream(xml.getBytes()));今天在学习Ajax时后,写到
Document xmlDoc = (Document)new XPPReader().read(new ByteArrayInputStream(xml.getBytes()));
一直报错误,提示
Multiple annotations found at this line:
- The type org.gjt.xpp.XmlPullParserException cannot be resolved. It is indirectly referenced from
required .class files
- The method read(InputStream) from the type XPPReader refers to the missing type XmlPullParserException
- The type org.gjt.xpp.XmlPullParserException cannot be resolved. It is indirectly referenced from
required .class files
- The method read(InputStream) from the type XPPReader refers to the missing type XmlPullParserException
异常,查了半天,并且看了源代码,原因是,找不到
import org.gjt.xpp.XmlPullParserException;的包,于是,网上各种找,都没有结果。随后在dom4j的源代码包中找到了
pull-parser-2.1.10.jar架包,于是加入,顺利解决。
相关文章推荐
- org.gjt.xpp.XmlPullParserException 错误解决
- 解析xml文件时,错误信息org.xml.sax.SAXParseException:Parser has reached the entity expansion limit "64,000" set by the Application.的解决办法
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- org.xml.sax.SAXParseException: Failed to read schema document错误的完美解决方法 以及 Spring如何加载XSD文件
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Maven项目总是出现org.hibernate.HibernateException: /hibernate.cfg.xml not found错误的解决方法
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- 在进行xml解析时,出现XmlPullParserException:Unexpected token(position:unknown @2:1错误
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver错误在eclipse中的解决方法
- xml解析请求DTD错误的解决办法(断网服务器下):org.xml.sax.SAXParseExceptionpublicId
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- android用SAX解析xml文件时抛出org.apache.harmony.xml.ExpatParser$ParseException异常的解决方法
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog 终极解决
- sax错误:org.xml.sax.SAXParseException: Content is not allowed in prolog解决
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)
- Spring如何加载XSD文件(org.xml.sax.SAXParseException: Failed to read schema document错误的解决方法)