XStream
  1. XStream
  2. XSTR-71

xstream.fromXML() requires XPP3 where xstream.toXML doesn't

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 1.0
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Now that the default driver for new XStream() is the XppDriver, there seems to be a dependency on the XPP3 library in the xstream.fromXML(String) method. However, according to the commit comment of XStream.java, revision 1.42, XPP3 should still be optional...

      "Default XStream constructor uses XPP3. Updated docs to recommend including this jar (although it is still optional)"

      The dependency is apparent in the XStreamSerializationTestCase.java, revision 1.1, in the Picocontainer CVS.
      http://cvs.picocontainer.codehaus.org/java/picocontainer/src/test/org/picocontainer/defaults/XStreamSerialisationTestCase.java

      In it, new XStream() is used, implicitly using the XppDriver (although an explicit DomDriver has been used in revision 1.2 to avoid this problem). Here's the error...

      Testcase: testShouldBeAbleToSerialiseEmptyPico(org.picocontainer.defaults.XStreamSerialisationTestCase): Caused an ERROR
      XPP3 pull parser library not present. Specify another driver. For example: new XStream(new DomDriver())
      java.lang.IllegalArgumentException: XPP3 pull parser library not present. Specify another driver. For example: new XStream(new DomDriver())
      at com.thoughtworks.xstream.io.xml.XppDriver.createReader(Unknown Source)
      at com.thoughtworks.xstream.XStream.fromXML(Unknown Source)
      at com.thoughtworks.xstream.XStream.fromXML(Unknown Source)
      at org.picocontainer.defaults.XStreamSerialisationTestCase.testShouldBeAbleToSerialiseEmptyPico(XStreamSerialisationTestCase.java:20)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

      So, it looks as if the XPP3 library is required. I would think that XStream would fall back to the DomDriver if XPP3 doesn't exist in the classpath.

      Jake

        People

        • Assignee:
          Unassigned
          Reporter:
          Jacob Kjome
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: