Hello List:

I'm in the process of migrating a project from java 6 to java 7. The project 
had been using XStream 1.3. We had to update that to XStream 1.4.4 because of 
java 7. Most things now work. However, we have some old xml files written by an 
unknown version of XStream that can't be deserialized now. The problem is with 
SynchronizedList. Here's the error I get:

com.thoughtworks.xstream.converters.ConversionException: Cannot deserialize 
object with new readObject()/writeObject() methods
---- Debugging information ----
class               : java.util.Collections$SynchronizedList
required-type       : java.util.Collections$SynchronizedList
converter-type      : 
com.thoughtworks.xstream.converters.reflection.SerializableConverter
path                : /java.util.Collections-SynchronizedRandomAccessList
line number         : 1


The xml file looks like this:

<java.util.Collections-SynchronizedRandomAccessList 
resolves-to="java.util.Collections-SynchronizedList">
  <list>
      ... the list content
  </list>
  <c class="list" reference="../list"/>
  <mutex class="java.util.Collections-SynchronizedList">
    <list reference="../../list"/>
    <c class="list" reference="../../list"/>
    <mutex class="java.util.Collections-SynchronizedList" reference=".."/>
  </mutex>
</java.util.Collections-SynchronizedRandomAccessList>

Here's the code that creates the XStream instance:

        XStream xstream = new XStream(new XppDriver(new 
XStream11XmlFriendlyReplacer())) {
            @Override
            protected boolean useXStream11XmlFriendlyMapper() {
                return true;
            }
        };

I also tried using XStream11NameCoder instead of the 
XStream11XmlFriendlyReplacer with the same results.

Any ideas?

Thanks,

Rad Widmer

Reply via email to