Hi Christine,

Christine wrote:

> I have been using XStream on Android for a couple of years, it always
> worked well. However, in my latest project I get this error:
> 
> java.lang.RuntimeException: Stub!
>      at
> 
org.xmlpull.v1.XmlPullParserFactory.newInstance(XmlPullParserFactory.java:14)
>      at
> com.thoughtworks.xstream.io.xml.XppDriver.createParser(XppDriver.java:57)
> 
> I use Android Jellybean, I take it they made changes in the
> XmlPullParserFactory, causing the Stub! error. I have seen Stub errors
> in Android HttpClient also, so you have to have a valid httpClient jar
> which is higher on the "order and export" list than android.jar.
> 
> I have solved my problem with xstream by supplying a jar containging an
> XmlPullParserFactory class, I use xpp3-1.1.2a.jar. Would this be the
> right jar?

First of all: I have no experience with Android at all.

However, AFAICS is Android normally delivered with a XmlPullParser 
implementation, therefore I am not sure, what causes this problem. And if 
you look at the stack trace, you can see that Android has already a 
XmlPullParserFactory. The question is, why it can no longer find a parser 
implementation.

You may examine the jar files in use yourself. The XmlPullParserFactory 
looks for a file "META-INF/services/org.xmlpull.v1.XmlPullParserFactory" 
that contains the class name of the parser.

To avoid the XmlPullParserFactory completely, you can deliver your own 
XmlPullParser - either kXML2 or Xpp3. Just use the appropriate driver 
directly and add the matching jar file (both parsers are functional with the 
minimal variant).

Regards,
Jörg


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to