在 Tomcat7 服务器上用 Java 创建新实例时 XmlPullParser 异常 [英] XmlPullParser exception when creating new instance in Java on Tomcat7 server

查看:32
本文介绍了在 Tomcat7 服务器上用 Java 创建新实例时 XmlPullParser 异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有 Tomcat 7 和 jre 7 的 Eclipse 开发动态 Web 应用程序.尝试解析 xml 字符串时收到以下异常:

I am working on a dynamic web app using Eclipse with Tomcat 7 and jre 7. I receive the following exception when attempting to parse an xml string:

无法加载任何工厂类(即使是小的或完整的默认实现);嵌套异常是:org.kxml2.io.XmlReader

XmlPullParserFactory factory = XmlPullParserFactory.newInstance();

XmlPullParserFactory factory = XmlPullParserFactory.newInstance();

它是 org.xmlpull.v1.XmlPullParserFactory 命名空间的一部分.

which is part of the org.xmlpull.v1.XmlPullParserFactory namespace.

我已将 xmlpull_1_0_5.jar 放入 Tomcat lib 文件夹并重新启动它.我也把文件放在 WEB-INF lib 文件夹中.

I have put the xmlpull_1_0_5.jar into the Tomcat lib folder and restart it. I have also put the file in the WEB-INF lib folder.

任何帮助将不胜感激!谢谢!

Any help would be appreciated! Thanks!

推荐答案

删除您拥有的一个并使用 KXML2 实现.从这里下载:link

Remove the one you have and use the KXML2 implementation. Download from here: link

更多信息

这篇关于在 Tomcat7 服务器上用 Java 创建新实例时 XmlPullParser 异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆