title: com.thoughtworks.xstream.mapper.CannotResolveClassException
body: <p>This is the frist time I am trying XStream.
  But when I try to parse my xml file i am getting this exception : </p>
  
  <pre><code>Exception in thread "main" com.thoughtworks.xstream.mapper.CannotResolveClassException: root
      at com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:79)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:55)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:79)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:74)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:30)
      at com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:45)
      at com.thoughtworks.xstream.core.util.HierarchicalStreams.readClassType(HierarchicalStreams.java:29)
      at com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:133)
      at com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:32)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1157)
      at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:1141)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1012)
      at com.mmm.transport.se.xmleditor.xml.TestXML.test(TestXML.java:20)
      at com.mmm.transport.se.xmleditor.domain.Main.main(Main.java:13)
  </code></pre>
  
  <p>So we can see that the error is on row 20 in my testXML class. And it looks like this : </p>
  
  <pre><code>public class TestXML {
  
      public void test() throws FileNotFoundException {
  
          FileReader reader = new FileReader("xmlFiles/CoreDatamodel.xml");
  
          XStream xstream = new XStream();
          xstream.processAnnotations(Properties.class);
          xstream.processAnnotations(Parameters.class);
          xstream.processAnnotations(ObjType.class);
          xstream.processAnnotations(Type.class);
          Type data = (Type) xstream.fromXML(reader);
  
          System.out.println(data);
      }
  
  }
  </code></pre>
  
  <p>And row 20 is the this line : <code>xstream.processAnnotations(Parameters.class);</code></p>
  
  <pre><code>@XStreamAlias("param")
  public class Parameters {
  
      @XStreamAlias("DATATYPE")
      private String datatype;
      @XStreamAlias("DESCRIPTION")
      private String description;
      @XStreamAlias("MIN_NO")
      private String min_no;
      @XStreamAlias("MAX_NO")
      private String max_no;
      @XStreamAlias("ORDER1")
      private String order1;
      @XStreamAlias("NESTED")
      private String nested;
      @XStreamAlias("DEFAULT1")
      private String default1;
      @XStreamAlias("FORMAT")
      private String format;
      @XStreamAlias("PARAMETER")
      private String parameter;
  
      public Parameters(String datatype, String description, String min_no,
              String max_no, String order1, String nested, String default1,
              String format, String parameter) {
          super();
  
          setDatatype(datatype);
          setDescription(description);
          setMin_no(min_no);
          setMax_no(max_no);
          setOrder1(order1);
          setNested(nested);
          setDefault1(default1);
          setFormat(format);
          setParameter(parameter);
  
      } //Getters and setters..
  </code></pre>
  
  <p>And the xml looks like this : </p>
  
  <pre><code>- &lt;root&gt;
  - &lt;info&gt;
    &lt;CORE_NAME&gt;DataModel_Core&lt;/CORE_NAME&gt; 
    &lt;CORE_VERSION&gt;..&lt;/CORE_VERSION&gt; 
    &lt;CORE_PRODUCT_ID&gt;...&lt;/CORE_PRODUCT_ID&gt; 
    &lt;ADAPTATION_NAME /&gt; 
    &lt;ADAPTATION_VERSION /&gt; 
    &lt;ADAPTATION_PRODUCT_ID /&gt; 
    &lt;/info&gt;
  - &lt;type&gt;
    &lt;OBJECT_TYPE&gt;data&lt;/OBJECT_TYPE&gt; 
  - &lt;prop&gt;
    &lt;DESCRIPTION&gt;Site parameters&lt;/DESCRIPTION&gt; 
    &lt;PARENT&gt;NULL&lt;/PARENT&gt; 
    &lt;VIRTUAL&gt;0&lt;/VIRTUAL&gt; 
    &lt;VISIBLE&gt;1&lt;/VISIBLE&gt; 
    &lt;PICTURE&gt;NULL&lt;/PICTURE&gt; 
    &lt;HELP&gt;10008&lt;/HELP&gt; 
    &lt;MIN_NO&gt;1&lt;/MIN_NO&gt; 
    &lt;MAX_NO&gt;1&lt;/MAX_NO&gt; 
    &lt;NAME_FORMAT&gt;NULL&lt;/NAME_FORMAT&gt; 
    &lt;/prop&gt;
  - &lt;param&gt;
    &lt;PARAMETER&gt;nidRbc&lt;/PARAMETER&gt; 
    &lt;DATA_TYPE&gt;INTEGER&lt;/DATA_TYPE&gt; 
    &lt;DESCRIPTION&gt;RBC identity&lt;/DESCRIPTION&gt; 
    &lt;MIN_NO&gt;1&lt;/MIN_NO&gt; 
    &lt;MAX_NO&gt;1&lt;/MAX_NO&gt; 
    &lt;ORDER1&gt;1&lt;/ORDER1&gt; 
    &lt;NESTED&gt;0&lt;/NESTED&gt; 
    &lt;DEFAULT1&gt;NULL&lt;/DEFAULT1&gt; 
    &lt;FORMAT&gt;0:16382&lt;/FORMAT&gt; 
    &lt;/param&gt;
  &lt;/type&gt;
  </code></pre>
  
  <p></p>
  
  <p>Other classes involved looks like this : </p>
  
  <pre><code>public class Type {
  
      @XStreamImplicit(itemFieldName = "type")
      private List types = new ArrayList();
  
  }
  
  public class ObjType {
  
      @XStreamAlias("OBJECT_TYPE")
      private String objectType;
  
      public ObjType() {
  
      } // Getters and setters
  
  @XStreamAlias("prop")
  public class Properties {
  
      @XStreamAlias("DESCRIPTION")
      private String description;
      @XStreamAlias("PARENT")
      private String parent;
      @XStreamAlias("VIRTUAL")
      private String virtual;
      @XStreamAlias("VISIBLE")
      private String visible;
      @XStreamAlias("PICTURE")
      private String picture;
      @XStreamAlias("HELP")
      private String help;
      @XStreamAlias("MIN_NO")
      private String min_no;
      @XStreamAlias("MAX_NO")
      private String max_no;
      @XStreamAlias("NAME_FORMAT")
      private String name_format;
      public static Properties instance = null;
  
      public static Properties getInstance() {
  
          if (instance == null) {
  
              instance = new Properties();
  
          }
  
          return instance;
      }
  
      public Properties() {
  
      } // Getters and Setters.
  </code></pre>
  
  <p>Whats the cause of this error?</p>