title: xStream deserialisation of HashMap<String, List<String>> XML File
body: <p>serialisation works fine, but desirialisation wount work.
  I will post my Code and the errors copies from Eclipse.</p>
  
  <pre><code>    &lt;dependency&gt;      &lt;!-- for XML --&gt;
          &lt;artifactId&gt;xstream&lt;/artifactId&gt;
          &lt;groupId&gt;com.thoughtworks.xstream&lt;/groupId&gt;
          &lt;version&gt;1.4.7&lt;/version&gt;
      &lt;/dependency&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;xpp3&lt;/groupId&gt;
          &lt;artifactId&gt;xpp3&lt;/artifactId&gt;
          &lt;version&gt;1.1.4c&lt;/version&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>    public static void serialize(File file, Graph g) {
      HashMap&lt;String, List&lt;String&gt;&gt; imageTMP = g.getImageURLmap();
      HashMap&lt;Coordinate, String&gt; coordTMP = g.getCoordMap();
      // ... and serialize it via XMLEncoder to file
      XStream xStream = new XStream();
      try {
          FileOutputStream outputStream = new FileOutputStream(file);
          OutputStream buff = new BufferedOutputStream(outputStream);
          OutputStreamWriter writer = new OutputStreamWriter(buff, Charset.forName("UTF-8"));
          xStream.toXML(imageTMP, writer);
          xStream.toXML(coordTMP, outputStream);
          writer.close();
      } catch (FileNotFoundException e1) {
          // TODO Auto-generated catch block
          e1.printStackTrace();
      } catch (IOException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
      }
  }
  
  @SuppressWarnings("unchecked")
  public static void deserializeImage(File file, Graph g) {
      HashMap&lt;String, List&lt;String&gt;&gt; imageTMP;
      HashMap&lt;Coordinate, String&gt; coordTMP;
      XStream xStream = new XStream();
      try {
          FileInputStream inputStream = new FileInputStream(file);
          BufferedInputStream buff = new BufferedInputStream(inputStream);
          InputStreamReader reader = new InputStreamReader(buff, Charset.forName("UTF-8"));
          ObjectInputStream in = xStream.createObjectInputStream(inputStream);
          imageTMP = (HashMap&lt;String, List&lt;String&gt;&gt;) in.readObject();
          coordTMP = (HashMap&lt;Coordinate, String&gt;) in.readObject();
          reader.close();
      } catch (Exception e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
          imageTMP = new HashMap&lt;String, List&lt;String&gt;&gt;();
          coordTMP = new HashMap&lt;Coordinate, String&gt;();
      }
      g.setImageURLmap(imageTMP);
      g.setCoordMap(coordTMP);
  }
  </code></pre>
  
  <p>The XML:</p>
  
  <pre><code>    &lt;map&gt;
        &lt;entry&gt;
          &lt;string&gt;Netto&lt;/string&gt;
          &lt;list/&gt;
        &lt;/entry&gt;
        &lt;entry&gt;
          &lt;string&gt;Sparkasse&lt;/string&gt;
          &lt;list&gt;
            &lt;string&gt;http://upload.wikimedia.org/wikipedia/commons/4/47/Salem_Rechnung.jpg&lt;/string&gt;
            &lt;string&gt;http://upload.wikimedia.org/wikipedia/de/8/83/Sparkasse.svg&lt;/string&gt;
            &lt;string&gt;http://upload.wikimedia.org/wikipedia/de/3/38/ErsteBank_Sparkasse_Logo.svg&lt;/string&gt;
            &lt;string&gt;http://upload.wikimedia.org/wikipedia/commons/8/88/Caixa_Manlleu_branch.JPG&lt;/string&gt;
          &lt;/list&gt;
        &lt;/entry&gt;
        &lt;entry&gt;
          &lt;string&gt;Bohlmann und Meyer&lt;/string&gt;
          &lt;list/&gt;
        &lt;/entry&gt;
        &lt;entry&gt;
          &lt;string&gt;Langwedel&lt;/string&gt;
          &lt;list/&gt;
        &lt;/entry&gt;
      &lt;/map&gt;&lt;map&gt;
        &lt;entry&gt;
          &lt;com.vividsolutions.jts.geom.Coordinate&gt;
            &lt;x&gt;9.18013565&lt;/x&gt;
            &lt;y&gt;52.983609799999996&lt;/y&gt;
            &lt;z&gt;NaN&lt;/z&gt;
          &lt;/com.vividsolutions.jts.geom.Coordinate&gt;
          &lt;string&gt; &lt;/string&gt;
        &lt;/entry&gt;
        &lt;entry&gt;
          &lt;com.vividsolutions.jts.geom.Coordinate&gt;
            &lt;x&gt;9.1815044&lt;/x&gt;
            &lt;y&gt;52.9855979&lt;/y&gt;
            &lt;z&gt;NaN&lt;/z&gt;
          &lt;/com.vividsolutions.jts.geom.Coordinate&gt;
          &lt;string&gt; &lt;/string&gt;
        &lt;/entry&gt;
      &lt;/map&gt;
  </code></pre>
  
  <p>With new XStream(); I get:</p>
  
  <pre><code>com.thoughtworks.xstream.converters.ConversionException: Cannot construct java.util.Map$Entry : java.util.Map$Entry : Cannot construct java.util.Map$Entry : java.util.Map$Entry
  ---- Debugging information ----
  message             : Cannot construct java.util.Map$Entry : java.util.Map$Entry
  cause-exception     : com.thoughtworks.xstream.converters.reflection.ObjectAccessException
  cause-message       : Cannot construct java.util.Map$Entry : java.util.Map$Entry
  class               : java.util.Map$Entry
  required-type       : java.util.Map$Entry
  converter-type      : com.thoughtworks.xstream.converters.reflection.ReflectionConverter
  path                : /entry
  line number         : 1
  version             : 1.4.7
  -------------------------------
         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:79)
         at com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:65)
         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:66)
         at com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:50)
         at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:134)
         at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1185)
         at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1157)
         at com.thoughtworks.xstream.XStream$4.readFromStream(XStream.java:1851)
         at com.thoughtworks.xstream.core.util.CustomObjectInputStream.readObjectOverride(CustomObjectInputStream.java:120)
         at java.io.ObjectInputStream.readObject(Unknown Source)
         at org.opentripplanner.util.SeMo_Wiki.deserializeImage(SeMo_Wiki.java:255)
         at org.opentripplanner.graph_builder.GraphBuilderTask.run(GraphBuilderTask.java:153)
         at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:61)
  Caused by: com.thoughtworks.xstream.converters.reflection.ObjectAccessException: Cannot construct java.util.Map$Entry : java.util.Map$Entry
         at com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider.newInstance(SunLimitedUnsafeReflectionProvider.java:80)
         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.instantiateNewInstance(AbstractReflectionConverter.java:553)
         at com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:256)
         at com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:72)
         ... 13 more
  Caused by: java.lang.InstantiationException: java.util.Map$Entry
         at sun.misc.Unsafe.allocateInstance(Native Method)
         at com.thoughtworks.xstream.converters.reflection.SunLimitedUnsafeReflectionProvider.newInstance(SunLimitedUnsafeReflectionProvider.java:76)
         ... 16 more
  </code></pre>
  
  <p>And with new XStream(new DomDriver()); </p>
  
  <pre><code>[Fatal Error] :127:8: Markup im Dokument nach dem Root-Element muss ordnungsgemäß formatiert sein.
  com.thoughtworks.xstream.io.StreamException:  : Markup im Dokument nach dem Root-Element muss ordnungsgemäß formatiert sein.
         at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:105)
         at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:77)
         at com.thoughtworks.xstream.XStream.createObjectInputStream(XStream.java:1812)
         at org.opentripplanner.util.SeMo_Wiki.deserializeImage(SeMo_Wiki.java:253)
         at org.opentripplanner.graph_builder.GraphBuilderTask.run(GraphBuilderTask.java:153)
         at org.opentripplanner.standalone.OTPMain.main(OTPMain.java:61)
  Caused by: org.xml.sax.SAXParseException; lineNumber: 127; columnNumber: 8; Markup im Dokument nach dem Root-Element muss ordnungsgemäß formatiert sein.
         at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(Unknown Source)
         at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(Unknown Source)
         at com.thoughtworks.xstream.io.xml.DomDriver.createReader(DomDriver.java:98)
         ... 5 more
  </code></pre>
  
  <p>Did anyone has an advice for me? I totaly tried out everything I can mention?
  Even ONLY the simplier <code>HashMap&lt;Coordinate, String&gt;</code> alone does not work (<code>HashMap&lt;String, List&lt;String&gt;&gt;</code> so not seems to be the problem with generics or so on...)</p>
  
  <p>Greatings D.</p>