<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://blog.gmane.org/gmane.comp.java.xstream.user">
    <title>gmane.comp.java.xstream.user</title>
    <link>http://blog.gmane.org/gmane.comp.java.xstream.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8139"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8133"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8131"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8129"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8125"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8119"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8114"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8110"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8109"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8104"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8101"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8098"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8094"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8090"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8086"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8073"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8071"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8065"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8055"/>
        <rdf:li rdf:resource="http://comments.gmane.org/gmane.comp.java.xstream.user/8050"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8139">
    <title>XStream ConversionException the second time I parse an XML file</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8139</link>
    <description>&lt;pre&gt;Hi everyone,

I'm trying to read a TreeMap from an XML file using XStream (I previously
created the XML file using XStream too) in my Android application.

I simply do this in a static method of a class:

File f = new File(Environment.getExternalStorageDirectory(), "map.xml");

XStream xStream = new XStream(new DomDriver());

&amp;lt; at &amp;gt;SuppressWarnings("unchecked")
TreeMap&amp;lt;String,Object&amp;gt; map = (TreeMap&amp;lt;String,Object&amp;gt;) xStream.fromXML(f);

and then I use the values from the TreeMap with no problems... the first
time.

The thing is, if I invoke the method for a second time, it doesn't matter
if I do it just after the first execution or after a while, I get this:

05-24 08:33:53.404: E/AndroidRuntime(15543): FATAL EXCEPTION: main
05-24 08:33:53.404: E/AndroidRuntime(15543):
com.thoughtworks.xstream.converters.ConversionException: null : null
05-24 08:33:53.404: E/AndroidRuntime(15543): ---- Debugging information ----
05-24 08:33:53.404: E/AndroidRuntime(15543): cause-exception     :
java.lang.NullPointerException
05-24 08:33:53.404: E/AndroidRuntime(15543): cause-message       : null
05-24 08:33:53.404: E/AndroidRuntime(15543): class               :
java.util.TreeMap
05-24 08:33:53.404: E/AndroidRuntime(15543): required-type       :
java.util.TreeMap
05-24 08:33:53.404: E/AndroidRuntime(15543): converter-type      :
com.thoughtworks.xstream.converters.collections.TreeMapConverter
05-24 08:33:53.404: E/AndroidRuntime(15543): path                : /tree-map
05-24 08:33:53.404: E/AndroidRuntime(15543): version             : 0.0
05-24 08:33:53.404: E/AndroidRuntime(15543): -------------------------------
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
[...]
05-24 08:33:53.404: E/AndroidRuntime(15543): Caused by:
java.lang.NullPointerException
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
java.util.TreeMap.find(TreeMap.java:277)
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
java.util.TreeMap.putInternal(TreeMap.java:240)
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
java.util.TreeMap.put(TreeMap.java:186)
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
java.util.AbstractMap.putAll(AbstractMap.java:381)
05-24 08:33:53.404: E/AndroidRuntime(15543):    at
com.thoughtworks.xstream.converters.collections.TreeMapConverter.populateTreeMap(TreeMapConverter.java:150)
[...]

with the same file. In fact, if I try to read the file and then pass it to
XStream as a String, I get the same exception (but the XML String is
created OK).

Does anyone know what the cause could be or has experienced the same
problem and know how to fix it?

Thanks!

Gonzalo Rodríguez Píriz.
&lt;/pre&gt;</description>
    <dc:creator>Gonzalo Rodríguez Píriz</dc:creator>
    <dc:date>2012-05-24T10:13:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8133">
    <title>custom Map converter with XStreamImplicit anotation</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8133</link>
    <description>&lt;pre&gt;I would like to produce from a HashMap following XML:
&amp;lt;a id="map_key"&amp;gt;map_value&amp;lt;/a&amp;gt;

I tried:
&amp;lt; at &amp;gt;XStreamImplicit(keyFieldName = "a")
&amp;lt; at &amp;gt;XStreamConverter(MyMapConverter.class)
HashMap&amp;lt;String, String&amp;gt; map = new HashMap&amp;lt;String, String&amp;gt;();

But this combination never enters MyMapConverter.

Is there a way to achieve this ?

Thank you.
&lt;/pre&gt;</description>
    <dc:creator>Martin Minka</dc:creator>
    <dc:date>2012-05-23T18:55:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8131">
    <title>Getting CannotResolveClassException</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8131</link>
    <description>&lt;pre&gt;Hi Guys,

I am using com.thoughtworks.xstream v1.3.1.  And trying to load XML file to java object.

While doing so getting CannotResolveClassException error for the class CategoryRuleMap which is present at the required location.

This functionality was working with Sonar plugin api - 1.10. I have upgraded Sonar plugin api to 3.0 and this has stopped working. Any clue what could be the issue.

Below is the code snippet I have:

        InputStream input = getClass().getResourceAsStream(CATEGORY_MAP_FILE);
    categoryRuleMap = new CategoryRuleMap();

    XStream xstream = new XStream();
    xstream.alias("CategoryRuleMap", CategoryRuleMap.class);
    xstream.alias("category", CategoryMap.class);
    xstream.aliasAttribute(CategoryMap.class, "name", "name");
    xstream.alias("rule", String.class);
    xstream.addImplicitCollection(CategoryRuleMap.class, "categories");

    xstream.fromXML(input, categoryRuleMap);

Error trace:

 [INFO] Trace
com.thoughtworks.xstream.mapper.CannotResolveClassException: abc.def.CategoryRuleMap : abc.def.CategoryRuleMap
        at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:68)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:86)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:96)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
        at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:52)
        at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
        at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:136)
        at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
        at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
        at com.thoughtworks.xstream.XStream.fromXML(XStream.java:891)

Please help.

Regards,
Anshuma.

**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely 
for the use of the addressee(s). If you are not the intended recipient, please 
notify the sender by e-mail and delete the original message. Further, you are not 
to copy, disclose, or distribute this e-mail or its contents to any other person and 
any such actions are unlawful. This e-mail may contain viruses. Infosys has taken 
every reasonable precaution to minimize this risk, but is not liable for any damage 
you may sustain as a result of any virus in this e-mail. You should carry out your 
own virus checks before opening the e-mail or attachment. Infosys reserves the 
right to monitor and review the content of all messages sent to or from this e-mail 
address. Messages sent to or from this e-mail address may be stored on the 
Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***
&lt;/pre&gt;</description>
    <dc:creator>Anshuma Ashok Goyal</dc:creator>
    <dc:date>2012-05-23T12:13:54</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8129">
    <title>Jettison upgrade changes json</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8129</link>
    <description>&lt;pre&gt;Hi,
after upgrading xstream from 1.3.1 to 1.4.2 and jettison 1.0.1 to 1.2 (or 1.3.1) the generated json string changed. I could also change the javascript processing of the json string, but the new version looks strange to me.

I try to serialize the following object tree:

class userlist {
private List&amp;lt;User&amp;gt; users;
}

class User {
private name;
private vorname;
}


After the upgrade the json string contains collections at two different levels.

Old
{"userlist":{"users":{"user":[{"name":"x","vorname":"y"},{"name":"x","vorname":"y"}]}}}

New
{"userlist":{"users":[{"user":[{"name":"x","vorname":"y"},{"name":"x","vorname":"y"}]}]}}

Is this ok and i should change my code? or is this a bug?

Thanks
Andi



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Andreas Sachs</dc:creator>
    <dc:date>2012-05-13T00:41:28</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8125">
    <title>Customizing JSON Map serialization</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8125</link>
    <description>&lt;pre&gt;Hi,

I'm trying to serialize to JSON an object that has a HashMap field, the
output is something like this:

"originalAuthor": [
            [
              "organisation",
              "Ocean Informatics"
            ],
            [
              "name",
              "Chunlan Ma"
            ],
            [
              "date",
              "16/11/2006"
            ]
          ]

But I expected something more like a JSON object:

"originalAuthor": {
              "organisation": "Ocean Informatics",
              "name": "Chunlan Ma",
              "date": "16/11/2006"
          }

This is a simple example, field values can be complex objects.


Is there some way of generating a structure like this for Map Java objects?

Thanks a lot.

&lt;/pre&gt;</description>
    <dc:creator>Pablo Pazos</dc:creator>
    <dc:date>2012-05-11T00:58:15</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8119">
    <title>configuring HibernateProxyConverter</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8119</link>
    <description>&lt;pre&gt;As part of going from xstream 1.3.1 to xstream 1.4.2, I'm trying to make
use of HibernateProxyConverter.

So I've changed the xstream configuration from, in 1.3.1:

         this.xstream = new XStream();
        xstream.registerConverter(new
JavaBeanConverter(xstream.getMapper()), XStream.PRIORITY_VERY_LOW);
        Mapper mapper = xstream.getMapper();
        xstream.registerConverter(new HibernateCollectionConverter(mapper));
        xstream.addDefaultImplementation(java.util.ArrayList.class,
org.hibernate.collection.PersistentList.class);
        xstream.addDefaultImplementation(java.util.HashMap.class,
org.hibernate.collection.PersistentMap.class);
        xstream.addDefaultImplementation(java.util.HashSet.class,
org.hibernate.collection.PersistentSet.class);
        xstream.addDefaultImplementation(java.util.ArrayList.class,
org.hibernate.collection.PersistentBag.class);
        xstream.alias("java.util.ArrayList",
org.hibernate.collection.PersistentBag.class);

to, in 1.4.2:

        xstream = new XStream() {
            protected MapperWrapper wrapMapper(final MapperWrapper next) {
                return new HibernateMapper(next);
            }
        };
        xstream.registerConverter(new HibernateProxyConverter());
        xstream.registerConverter(new
HibernatePersistentCollectionConverter(xstream.getMapper()));
        xstream.registerConverter(new
HibernatePersistentMapConverter(xstream.getMapper()));
        xstream.registerConverter(new
HibernatePersistentSortedMapConverter(xstream.getMapper()));
        xstream.registerConverter(new
HibernatePersistentSortedSetConverter(xstream.getMapper()));

That more or less seems to work, with this exception:

I have a java class that represents a relational table that is being
serialized by xstream.  But this class has some transient properties along
with the usual persistent properties that map to database columns.

Some of these transient properties are also java classes that I've defined.
 Something simple like a class that holds a name and value with a getter
and setter.

In my prior code, using xstream 1.3.1 and JavaBeanConverter, these
contained class instances were serialized and deserialized without issue.
 In the 1.4.2 code, though, these properties are not serialized, they are
omitted.

So it would seem that HibernateProxyConverter does not handle these.

I've been trying, without success, to add a second converter to handle
these.  I'm not sure that's the correct approach, though.  In general, I
could use some help, or guidance, on how best to do this.

Thanks,
Michael
&lt;/pre&gt;</description>
    <dc:creator>Michael Teixeira</dc:creator>
    <dc:date>2012-05-08T19:41:20</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8114">
    <title>How do I get the coorect value for XML special characters</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8114</link>
    <description>&lt;pre&gt;Hi,
 
I have an element with the following value ( &amp;lt;condition&amp;gt; a &amp;gt; b &amp;lt;/condition&amp;gt; ). When I put the value in the object and use Xstream.toXML the value comes &amp;lt;condition&amp;gt; a &amp;amp;gt; b&amp;lt;/condition&amp;gt;. How to get back the exact string with &amp;gt; character?
 
Thanks,
ajaya&lt;/pre&gt;</description>
    <dc:creator>Ajaya Sahoo</dc:creator>
    <dc:date>2012-05-04T03:34:25</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8110">
    <title>deserializing json with numbered object names</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8110</link>
    <description>&lt;pre&gt;Hello all,

I'm hoping to use XStream with the JettisonMappedXmlDriver to deserialize some 3rd party json output.

The json output includes numbers  as object names so in my example below propertyC actually has 3 nested objects but uses a number "1", "2", or "3" as the object name.  In my real world the json usually contains between 100 and 200 of these (it varies).

For instance:

{ "root" : { "propertyA " : "valueA",
      "propertyB" : "valueB",
      "propertyC" : { "1" : { "propertyC1" : "propertyC1_1_Value",
              "propertyC2" : "propertyC2_1_Value",
              "propertyC3" : "propertyC3_1_Value"
            },
          "2" : { "propertyC1" : "propertyC1_2_Value",
              "propertyC2" : "propertyC2_2_Value",
              "propertyC3" : "propertyC3_2_Value"
            },
          "3" : { "propertyC1" : "propertyC1_3_Value",
              "propertyC2" : "propertyC2_3_Value",
              "propertyC3" : "propertyC3_3_Value"
            }
        },
      "propertyD" : "valueD"
    } }

Can someone point me in the direction of what I'd have to do to make this work so that I could have the json deserialized into Java objects.  I thought I'd have the  Root object with it's simple properties/fields for propertyA, propertyB, and propertyD and a collection of propertyC but then I don't know how to configure a converter and/or aliases to handle the "1", "2","3" , etc all as the same object.  I'd like to build 3 objects of the same type and where it has an extra property that really represents the object name (the 1, 2 or 3, etc).

Are there some advance aliasing, converter  and/or other tricks I could use to make this reasonable with xstream and jettison or should I look into other json converting utilities?  I don't want to "preprocess" the json string to change its format.

Thanks!

Lynn Walton
Java Web Developer
ADP Digital Marketing Solutions
p 850.897.9467 | e lynn.walton-v7N2k3TrpGc&amp;lt; at &amp;gt;public.gmane.org&amp;lt;mailto:lynn.walton-v7N2k3TrpGc&amp;lt; at &amp;gt;public.gmane.org&amp;gt;
[cid:image001.gif-dIB8JcEPjFQyH7NoDPsJWzRmByFHzeGd&amp;lt; at &amp;gt;public.gmane.org]&amp;lt;http://adpdealerservices.com/&amp;gt;[cid:image002.gif-dIB8JcEPjFQyH7NoDPsJWzRmByFHzeGd&amp;lt; at &amp;gt;public.gmane.org]&amp;lt;http://cobalt.com/&amp;gt;[cid:image003.gif&amp;lt; at &amp;gt;01CD26DB.5E7E6F10]&amp;lt;http://bzresults.com/&amp;gt;[cid:image004.gif-dIB8JcEPjFQyH7NoDPsJWzRmByFHzeGd&amp;lt; at &amp;gt;public.gmane.org]&amp;lt;http://cobalt.com/dealix/&amp;gt;
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by email and delete the message and any attachments from your system.



This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
&lt;/pre&gt;</description>
    <dc:creator>Walton, Lynn</dc:creator>
    <dc:date>2012-04-30T19:39:18</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8109">
    <title>get rid of class="list" for more than one contained List interface fields</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8109</link>
    <description>&lt;pre&gt;
I have a container class as follows:
class FruitBasket { List&amp;lt;Apple&amp;gt; apples; List&amp;lt;Orange&amp;gt; oranges;}
I have added xstream.registerConverter(new HibernatePersistentCollectionConverter(xstream.getMapper()));I have also setup alias apple for com.myorg.Apple and com.myorg.Orange.
The marshalled FruitBasket object has:
&amp;lt;apples class="list"&amp;gt;  &amp;lt;apple&amp;gt;....&amp;lt;/apple&amp;gt;  &amp;lt;apple&amp;gt;....&amp;lt;/apple&amp;gt;&amp;lt;/apples&amp;gt;&amp;lt;oranges class="list"&amp;gt;  &amp;lt;orange&amp;gt;....&amp;lt;/orange&amp;gt;  &amp;lt;orange&amp;gt;....&amp;lt;/orange&amp;gt;&amp;lt;/oranges&amp;gt;
In order to get rid of the class="list" in apples and oranges, I added xstream.alias("apples", List.class, PersistentList.class);xstream.alias("oranges", List.class, PersistentList.class); The objects are marshalled all right, without the class= attributes.
But the client unmarshals, and fails with com.thoughtworks.xstream.mapper.CannotResolveClassException: oranges 
If I change the order of aliasing with oranges first instead of apples:xstream.alias("oranges", List.class, PersistentList.class);xstream.alias("apples", List.class, PersistentList.class);
then the CannotResolveClassException comes for apples.
Seems like at most one collection of the same interface type (List in this case) is end-to-end marshalled / unmarshalled all right for the FruitBasket container class.
I would like to know if there is a way around the problem.
       &lt;/pre&gt;</description>
    <dc:creator>Amit Basu</dc:creator>
    <dc:date>2012-04-29T19:31:56</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8104">
    <title>Class with an interface field saved as an id</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8104</link>
    <description>&lt;pre&gt;Hello,

 I am new to XStream, I got 95% of my task done in nearly no time, but now
I am stuck with trying to serialize the following class:

class MyClass {
    private String name;
    private Pattern pattern;
    // few more fields

    private ColumnPrinter&amp;lt;?&amp;gt; printer;
}

The printer can be an instance of any subclass (possibly anonymous) of the
ColumnPrinter interface. All must implement the getId() method and all are
registered in a global registry (by calling the method ColumnPrinter&amp;lt;?&amp;gt;
getPrinter(String id))

I would like to save all the fields the usual way, but for the printer, I
would like to save its id only (say as &amp;lt;printer&amp;gt;12&amp;lt;/printer&amp;gt;). Then when
deserializing the id should be read, and the proper instance should be
looked up in the global registry.

I am not sure how to do that. Can anybody help?

Thanks
Jirka
&lt;/pre&gt;</description>
    <dc:creator>Jirka Hana</dc:creator>
    <dc:date>2012-04-22T21:10:02</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8101">
    <title>IS XStream also Thread Safe while configured through Spring OXM</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8101</link>
    <description>&lt;pre&gt;Hi

http://xstream.codehaus.org/faq.html - says XStream is thread safe -
"Once the XStream instance has been created and configured, it may be
shared across multiple threads "

    XStream xstream = new XStream();
    Person person = (Person)xstream.fromXML(xml);

 So above piece of code should work fine in multi-threaded environment :


Coming to the Point -
I use Spring OXM ,where i can configure Marshaller/Unmarshaller in any of
the following ways :

&amp;lt;bean id="jaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"&amp;gt;
    &amp;lt;property name="classesToBeBound"&amp;gt; ....
                             OR
&amp;lt;bean id="xstreamMarshaller"
class="*org.springframework.oxm.xstream.XStreamMarshaller*"&amp;gt;
     &amp;lt;property name="aliases"&amp;gt; ......

   import *org.springframework.oxm.Marshaller*;
   import *org.springframework.oxm.Unmarshaller*;
   public class Application {
   private *Marshaller *marshaller;
   private *Unmarshaller *unmarshaller;

IS XStream also Thread Safe while configured through Spring-OXM(as above) ?

If so , then can we say org.springframework.oxm.*Marshaller *&amp;amp;
org.springframework.oxm.*Unmarshaller *also Thread Safe ? OR it depends on
the kind of marshaller (jaxbMarshaller/xstreamMarshaller) configured
through Spring OXM .

Clarification will be helpful . Thanks


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>satya</dc:creator>
    <dc:date>2012-04-18T16:34:53</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8098">
    <title>Class cast exception while instantiate converter</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8098</link>
    <description>&lt;pre&gt;Hi

I am getting the below exception while converting XML to object. I am using 
Xstream 1.4.1 and JDK 1.6.

It's working fine in one websphere server (RAD 7.5 and websphere 7.0) and it's 
not working in another websphere server 7.0.

Please tell me the reason, why i am getting the below exception.

com.thoughtworks.xstream.XStream$InitializationException: Could not instantiate 
converter : com.thoughtworks.xstream.converters.extended.DurationConverter : 
null
 at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter
(XStream.java:732)
 at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:696)
 at com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:445)
 at com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:385)
 at com.thoughtworks.xstream.XStream.&amp;lt;init&amp;gt;(XStream.java:342)
... 39 more
Caused by: 
java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
 at sun.reflect.NativeConstructorAccessorImpl.newInstance
(NativeConstructorAccessorImpl.java:56)
 at sun.reflect.DelegatingConstructorAccessorImpl.newInstance
(DelegatingConstructorAccessorImpl.java:39)
 at java.lang.reflect.Constructor.newInstance(Constructor.java:527)
 at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter
(XStream.java:725)
 ... 46 more
Caused by: 
java.lang.ClassCastException: 
org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl incompatible with 
javax.xml.datatype.DatatypeFactory
 at javax.xml.datatype.DatatypeFactory.newInstance(Unknown Source)
 at com.thoughtworks.xstream.converters.extended.DurationConverter.&amp;lt;init&amp;gt;
(DurationConverter.java:33)
 ... 51 more



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Mahesh</dc:creator>
    <dc:date>2012-04-17T19:32:05</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8094">
    <title>HashMap containing unknown values</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8094</link>
    <description>&lt;pre&gt;Hi

I am having some difficulties making xstream intrepret the xml that are
being delivered to me.

In short on the java side I want to have a hashmap&amp;lt;string,string&amp;gt;
containing entities inside the xml tag called log, the attributes on info
are wildcard (the sender of the xml can write whatever he wants)

&amp;lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&amp;gt;
&amp;lt;HttpInfo&amp;gt;
            &amp;lt;NetCoolLogLevel&amp;gt;0&amp;lt;/NetCoolLogLevel&amp;gt;
            &amp;lt;Log&amp;gt;
                         &amp;lt;Info id="1-LI031" status="OK"/&amp;gt;
                         &amp;lt;Info id="2-LI031" status="OK"/&amp;gt;
            &amp;lt;/Log&amp;gt;
            &amp;lt;DocLink&amp;gt;&amp;lt;/DocLink&amp;gt;
            &amp;lt;DocInfo&amp;gt;&amp;lt;/DocInfo&amp;gt;
&amp;lt;/HttpInfo&amp;gt;


This is what I've got:

Initial loading:
http://tinypaste.com/a6819c6c

Java (with annotations) for classes:
http://tinypaste.com/da379770

Current XML(working):
http://tinypaste.com/ecdb3470

Specified XML:
http://tinypaste.com/9aff0b98




&lt;/pre&gt;</description>
    <dc:creator>nino martinez wael</dc:creator>
    <dc:date>2012-04-13T09:23:14</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8090">
    <title>XStreamMarshaller does not unproxy at marshalling</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8090</link>
    <description>&lt;pre&gt;
I use a org.springframework.http.converter.xml.MarshallingHttpMessageConverter with org.springframework.oxm.xstream.XStreamMarshaller as marshaller/unmarshaller.
With default-lazy=false hibernate-mapping, org.springframework.web.client.RestTemplate.getForObject() works fine.
But with default-lazy = true, some contained objects from the top-level object are org.hibernate.proxy.pojo.javassist.SerializableProxy, which makes the getForObject() fail, with org.hibernate.LazyInitializationException- could not initialize proxy - no Session
Is there a way to get the marshaller to initialize and unproxy as needed, when writing to the stream ?
I want to have the same API calls for REST and non-REST situations (non-REST = local JVM calls that can make further calls with the Hibernate session, to get contents from proxies as needed), and ideally default-lazy = true is preferred for non-REST calls, but then if the same call is used by a REST controller, the marshalling keeps the proxies as is currently.       &lt;/pre&gt;</description>
    <dc:creator>Amit Basu</dc:creator>
    <dc:date>2012-04-11T02:32:48</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8086">
    <title>failure when trying to include xstream in pom.xml file</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8086</link>
    <description>&lt;pre&gt;I want to put xtream in my maven pom.xml,

But I keep getting an error:

Downloading: 
https://nexus.codehaus.org/content/groups/public/com/thoughtworks/xstream/xtream/1.4.1/xtream-1.4.1.pom
[WARNING] The POM for com.thoughtworks.xstream:xtream:jar:1.4.1 is 
missing, no dependency information available
Downloading: 
https://nexus.codehaus.org/content/groups/public/com/thoughtworks/xstream/xtream/1.4.1/xtream-1.4.1.jar
[INFO] 
------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] 
------------------------------------------------------------------------
[INFO] Total time: 1.398s
[INFO] Finished at: Mon Apr 09 17:13:36 MDT 2012
[INFO] Final Memory: 8M/109M
[INFO] 
------------------------------------------------------------------------

any ideas?

I have the nexus.codehaus.org maven repo configured as a repository and 
the path given above is the address to the .jar.  Are the thoughworks 
xstream poms messed up?

J.V.
&lt;/pre&gt;</description>
    <dc:creator>J.V.</dc:creator>
    <dc:date>2012-04-10T07:21:33</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8073">
    <title>ftp port 20 and 21.</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8073</link>
    <description>&lt;pre&gt;How can I set xstream to use only ports 20 and 21. currently it tries TCP ports
(39622, 64020, 39271, 12492, 44541)... and being blocked.

Please help
Thanks


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Paulo Hess</dc:creator>
    <dc:date>2012-03-29T18:33:13</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8071">
    <title>XStreamConverter annotation and caching</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8071</link>
    <description>&lt;pre&gt;Hi,

 I have a question concerning the new feature of the latest release 1.4.2, that now the XStreamConverter annotation takes additional parameters (very good feature and just what I need).

 How does the caching of the converter instances work now?
 Since the parameters are passed on to the constructor of the respective converter, the converters contain state and the caching could become more complicated..
 Or is there no caching any more in these cases?

 Thanks for any information.
&lt;/pre&gt;</description>
    <dc:creator>Benny Kannengiesser</dc:creator>
    <dc:date>2012-03-27T14:09:43</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8065">
    <title>Multiple aliases for system attribute</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8065</link>
    <description>&lt;pre&gt;Hallo,

Assume we have a xml fragment:

**************************************
&amp;lt;condition id="the-first"/&amp;gt;
&amp;lt;condition id="the-second"/&amp;gt;
&amp;lt;condition id="the-third"/&amp;gt;
&amp;lt;if if-ref="the-first" then-ref="the-second" else-ref="the-third"/&amp;gt;
***************************************

Obviously i want here to interpret attributes 'if-ref', 'then-ref' &amp;amp; 
'else-ref' as references to previously defined objects.
XStream.aliasSystemAttribute(...) allows just to redefine system 
attribute but does not allow to define several aliases
for it.

Custom converter does not help too because deserialised values are 
stored in private map
of ReferenceByIdUnmarshaller(AbstractReferenceUnmarshaller) class.

What could be the best solution for the problem?

Thank you in advance,
Vitali Nashkevich




---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



&lt;/pre&gt;</description>
    <dc:creator>Vitali Nashkevich</dc:creator>
    <dc:date>2012-03-22T23:57:58</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8055">
    <title>Confusion getting ISO8601 dates</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8055</link>
    <description>&lt;pre&gt;Hey all,

First off, I heart XStream. I just wanted to share a problem I had recently and how I solved it. It seems to me the solution is unintuitive and hard to find. This maybe isn't a bug, but at the very least I think it should be easier to do what I needed to do, or maybe his needs to be a FAQ or something.

So here's my story:

I noticed my dates were not being converted the way I wanted. After much searching I found this: http://jira.codehaus.org/browse/XSTR-116 Ah hah! that's all I need to do!

- first comment: that should be a FAQ or something. ISO8601 dates are pretty widely accepted as standard for XML, right? If they don't work automatically, it should be easy for people to figure out how to make them work, and I think the FAQ is the right place for that.

So I installed Jodatime, registered my converter and thought I was done with it. But I wasn't. Unbeknownst to me, my persistence engine was converting my java.util.date objects to java.sql.timestamp objects.... sometimes. One solution, of course, was to manually change that, since I was using different objects for persistence and XML conversion, but that seemed error-prone. Not a good solution. SO I thought the right was would be to make XStream handle this.

The problem was here:

public class ISO8601DateConverter extends ISO8601GregorianCalendarConverter {

    public boolean canConvert(Class type) {
        return type.equals(Date.class);
    }
...
}

The date converter was only handling java.util.Date classes and not subclasses. Was that intentional? I don't know, but my solution was to do this:

public static ISO8601DateConverter DATE_CONVERTER = new ISO8601DateConverter() {
    &amp;lt; at &amp;gt;Override
public boolean canConvert(Class type) {
    return Date.class.isAssignableFrom(type);
    }
};

That worked! horray! Now java.util.Date AND ALL SUBCLASSES are converted to ISO8601 dates, like I wanted.

- Second Comment/question: Is this a bug, or was that intentional? If it was intentional, is my subclassed cade safe?


Now here's the problem I don't really understand: the timestamp objects still converted like this:

&amp;lt;cTime class="sql-timestamp​"&amp;gt;2012-03-17T20:44:00.490Z&amp;lt;/cTime&amp;gt; 

So the date/time format is right, but the class annotation confuses XStream when trying to deserialize this. The solution, which was counterintuitive to me, was this:

XStream xstream = super.createXstream(mediaType);
xstream.addDefaultImplementation(java.sql.Date.class,java.util.Date.class);
xstream.addDefaultImplementation(java.sql.Timestamp.class,java.util.Date.class);
xstream.addDefaultImplementation(java.sql.Time.class,java.util.Date.class);
xstream.registerConverter(DATE_CONVERTER);

That gets rid of the pesky annotation, although I suppose some other subclass could come along and mess things up.

- Third comment/question: Is this the best way? Am I missing something? If this is the best way, I think there should be a better way as this is unintuitive and potentially error prone if another date subclass comes along.

Okay, thanks!

bjorn


-----------------------------
Bjorn Roche
http://www.xonami.com
Audio Collaboration
http://blog.bjornroche.com




&lt;/pre&gt;</description>
    <dc:creator>Bjorn Roche</dc:creator>
    <dc:date>2012-03-20T18:53:36</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8050">
    <title>Eliminate class fields during field determination</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8050</link>
    <description>&lt;pre&gt;So I have a class, let's call it X, that has a Map. That Map contains the
same reference to X.

I want it to ignore the Map so that it never explodes it while it is
finding the fields it needs to consider for serialization. Is there a way
to do this?

As near as I can tell, XStream considers all of the fields in a class, even
if you omit it from the output. This came from seeing those fields being
considered in AbstractReflectionConverter while stepping through the code.
Further, the omit appears in the code to only be considered during output.
Should I implement my own converter?

By the way, this problem yields an OutOfMemoryError due to non-stop
recursion. I'm using version 1.2.2 of XStream.
&lt;/pre&gt;</description>
    <dc:creator>Eric Lentz</dc:creator>
    <dc:date>2012-03-20T14:43:30</dc:date>
  </item>
  <item rdf:about="http://comments.gmane.org/gmane.comp.java.xstream.user/8045">
    <title>Serializer json with generics</title>
    <link>http://comments.gmane.org/gmane.comp.java.xstream.user/8045</link>
    <description>&lt;pre&gt;Hi,
    
    I've post this issue: https://jira.codehaus.org/browse/XSTR-696

    But I don't know if this is an issue or something that I'm doing wrong. I think that it is an issue, and for that I've create the jira issue.

    I've a generic pojo, ResulBean&amp;lt;E extends Serializable&amp;gt; that has a property, E bean. When E is an ArrayList&amp;lt;GnNode&amp;gt; the output is something like this:

    

{"&amp;lt; at &amp;gt;id": "1","bean": 
{"&amp;lt; at &amp;gt;class": "list","&amp;lt; at &amp;gt;id": "2",
"org.kyrian.entity.gnomo.GnNode": {"&amp;lt; at &amp;gt;id": "3","nodeId": 1,"nodeTitle": "nodo 1"},
"org.kyrian.entity.gnomo.GnNode": {"&amp;lt; at &amp;gt;id": "4","nodeId": 2,"nodeTitle": "nodo 2"}
}
}



    But I think the output must be something like this:


            bean:[                    

 {"&amp;lt; at &amp;gt;id": "3","nodeId": 1,"nodeTitle": "nodo 1"},                  

{"&amp;lt; at &amp;gt;id": "4","nodeId": 2,"nodeTitle": "nodo 2"}
            ]


    I'm doing something wrong?

    Lot of thanks,

        Marcial

&lt;/pre&gt;</description>
    <dc:creator>Atienzar Navarro, Marcial</dc:creator>
    <dc:date>2012-03-20T08:12:36</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.java.xstream.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.java.xstream.user</link>
  </textinput>
</rdf:RDF>

