Details
Description
We re-packaged xstream and xpp as osgi-bundles with proper meta-data, but the current XppDriver will fail to load XmlPullParserFactory.
We suggest the following code:
protected synchronized XmlPullParser createParser() throws XmlPullParserException { if (factory == null) { try { factory = XmlPullParserFactory.newInstance(null, XppDriver.class); } catch (final XmlPullParserException ex) { // fall-back for OSGi environment factory = XmlPullParserFactory.newInstance(); } } return factory.newPullParser(); }
Actually I am not sure what the XmlPullParserFactory does with the "context" parameter anyway, I could not find any documentation. If it actually causes trouble in OSGi, we can call the newInstance method immediately.