XStream
  1. XStream
  2. XSTR-707

It is hard to configure XStream in an OSGI environment.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.4.3
    • Fix Version/s: 1.4.4
    • Component/s: IO
    • Labels:
      None
    • JDK version and platform:
      Oracle 1.6 / 1.7 for Windows

      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();
          }
      

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Marco Lehmann-Mörz
        • Votes:
          0 Vote for this issue
          Watchers:
          2 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: