logo       

[xstream-dev] [jira] Closed: (XSTR-71) xstream.fromXML() requires XPP3 wher: msg#00026

java.xstream.devel

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

Message:

The following issue has been closed.

Resolver: Joe Walnes
Date: Sun, 25 Jul 2004 8:31 AM

After some discussion with users, I'm going to leave it how it is. Most users
prefer knowing which driver is being used over XStream choosing an appropriate
one. For example, you may intend to use XPP but due to an error in
configuration not have the library in the path.

So, I'm sticking with the explicit option.
---------------------------------------------------------------------
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: Closed
Priority: Major
Resolution: WON'T FIX

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: Sun, 25 Jul 2004 8:31 AM

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