【0】对 org.xmlpull.v1.XmlPullParserException 异常的解决方法
Exception in thread "main" java.lang.ExceptionInInitializerError
at org.jivesoftware.smack.SmackConfiguration.getVersion(SmackConfiguration.java:96)
at org.jivesoftware.smack.AbstractXMPPConnection.<clinit>(AbstractXMPPConnection.java:97)
at com.xmpp.client.ClientA.main(ClientA.java:15)
Caused by: java.lang.IllegalStateException: org.xmlpull.v1.XmlPullParserException: could not load any factory class (even small or full default imple
entation); nested exception is:
org.kxml2.io.XmlReader
at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:119)
... 3 more
Caused by: org.xmlpull.v1.XmlPullParserException: could not load any factory class (even small or full default implementation); nested exception is:
org.kxml2.io.XmlReader
at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:225)
at org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:76)
at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:153)
at org.jivesoftware.smack.SmackInitialization.processConfigFile(SmackInitialization.java:148)
at org.jivesoftware.smack.SmackInitialization.<clinit>(SmackInitialization.java:116)
... 3 more
【2】解决方法: 添加 kxml2 jar 到项目 即可;
How To Use It?
XMLPULL API is available freely. You can download XmlPull API as tarball or zip file. We are also providing access to the latest API version via anonymous CVS.
However to use XMLPULL you will need download an implementation of XmlPull API.
See http://www.xmlpull.org/impls.shtml#xmlpull for implementations that you can download.
简而言之, XMLPULL 仅仅是定义了接口,没有提供接口的实现, 而 KXML 提供了接口的实现,OK ?