logo       

[xstream-dev] [jira] Commented: (XSTR-71) xstream.fromXML() requires XPP3 w: msg#00016

java.xstream.devel

Subject: [xstream-dev] [jira] Commented: (XSTR-71) xstream.fromXML() requires XPP3 where xstream.toXML doesn't

The following comment has been added to this issue:

Author: Gr?gory Joseph
Created: Thu, 22 Jul 2004 7:15 PM
Body:
Well, the exception tells you what to do, doesn't it? I think optional means
just that, you have the option not to use.

(I personnaly prefer that over a failover scenario where xstream would use the
DomDriver if it doesn't find xpp)
---------------------------------------------------------------------
View this comment:
http://jira.codehaus.org/browse/XSTR-71?page=comments#action_22121

---------------------------------------------------------------------
View the issue:
http://jira.codehaus.org/browse/XSTR-71

Here is an overview of the issue:
---------------------------------------------------------------------
Key: XSTR-71
Summary: xstream.fromXML() requires XPP3 where xstream.toXML doesn't
Type: Bug

Status: Unassigned
Priority: Major

Original Estimate: Unknown
Time Spent: Unknown
Remaining: Unknown

Project: XStream
Versions:
1.0

Assignee:
Reporter: Jacob Kjome

Created: Sun, 16 May 2004 3:40 AM
Updated: Thu, 22 Jul 2004 7:15 PM

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


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
http://www.atlassian.com/software/jira




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise