在Tomcat7服务器上在Java中创建新实例时出现XmlPullParser异常

时间:2022-07-27 22:30:56

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:

我正在使用Tomcat 7和jre 7开发一个动态web应用程序。我在解析xml字符串时收到以下异常:

could not load any factory class (even small or full default implementation); nested exception is: org.kxml2.io.XmlReader

无法装入任何工厂类(甚至是小的或完全的默认实现);嵌套的异常:org.kxml2.io.XmlReader

XmlPullParserFactory factory = XmlPullParserFactory.newInstance();

XmlPullParserFactory工厂= XmlPullParserFactory.newInstance();

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

这是org.xmlpull.v1的一部分。XmlPullParserFactory名称空间。

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.

我已经将xmlpull_1_ 0_5放入。jar到Tomcat lib文件夹并重新启动它。我还把文件放在了WEB-INF lib文件夹中。

Any help would be appreciated! Thanks!

如有任何帮助,我们将不胜感激!谢谢!

1 个解决方案

#1


8  

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

删除已有的并使用KXML2实现。从这里下载:链接

More Info

更多信息

#1


8  

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

删除已有的并使用KXML2实现。从这里下载:链接

More Info

更多信息