title: Xtream com.thoughtworks.xstream.mapper.CannotResolveClassException
body: <p>I am trying XStream. But when I try to parse my xml file i am getting this exception. </p>
  
  <p>Xml Data is Below  : Categories>Category>Children>Category</p>
  
  <pre><code>&lt;SuccessResponse&gt;
   &lt;Head&gt;
        &lt;RequestId&gt;&lt;/RequestId&gt;
        &lt;RequestAction&gt;GetCategoryTree&lt;/RequestAction&gt;
        &lt;ResponseType&gt;Categories&lt;/ResponseType&gt;
        &lt;Timestamp&gt;2015-11-25T15:28:09+0800&lt;/Timestamp&gt;
   &lt;/Head&gt;
   &lt;Body&gt;
        &lt;Categories&gt;
             &lt;Category&gt;
              &lt;Name&gt;Chinese Books&lt;/Name&gt;
              &lt;CategoryId&gt;3460&lt;/CategoryId&gt;
              &lt;GlobalIdentifier&gt;chinese_books&lt;/GlobalIdentifier&gt;
              &lt;Children&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Literature&lt;/Name&gt;
                  &lt;CategoryId&gt;3461&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;literature2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Lifestyle Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3462&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;lifestyle_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Teens Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3463&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;teens_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Biography Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3464&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;biography_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Business Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3465&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;business_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Calendars&lt;/Name&gt;
                  &lt;CategoryId&gt;3466&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;calendars3&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Babies' Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3467&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;babies_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Toddlers' Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3468&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;toddlers_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Parent's Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3469&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;parents_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Children's Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3470&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;childrens_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Religion Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3471&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;religion_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Comic Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3472&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;comic_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Technology Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3473&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;technology_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Cooking Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3474&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;cooking_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Pre Sell Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3476&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;pre_sell_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Education Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3477&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;education_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Fitness Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3478&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;fitness_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;History Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3479&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;history_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Entertainment Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3480&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;entertainment_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Law Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3481&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;law_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Art Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3482&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;art_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Medical Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3483&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;medical_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Thrillers&lt;/Name&gt;
                  &lt;CategoryId&gt;3484&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;thrillers2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Relationship Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3485&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;relationship_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Social Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3486&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;social_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Professional Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3487&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;professional_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Romance&lt;/Name&gt;
                  &lt;CategoryId&gt;3488&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;romance3&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Science Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3489&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;science_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Science Fiction Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3490&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;science_fiction_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Self Help&lt;/Name&gt;
                  &lt;CategoryId&gt;3491&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;self_help2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Sport Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3492&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;sport_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Travel Books&lt;/Name&gt;
                  &lt;CategoryId&gt;3493&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;travel_books2&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Study Aids &amp;amp; Exam Preparations&lt;/Name&gt;
                  &lt;CategoryId&gt;8453&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;study_aids_exam_preparations&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Language, Linguistics &amp;amp; Writing&lt;/Name&gt;
                  &lt;CategoryId&gt;8455&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;language_linguistics_writing&lt;/GlobalIdentifier&gt;
                  &lt;Children&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;Language Learning &amp;amp; Teaching&lt;/Name&gt;
                      &lt;CategoryId&gt;8458&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;language_learning_teaching&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;Linguistics&lt;/Name&gt;
                      &lt;CategoryId&gt;8459&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;linguistics&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;Grammar&lt;/Name&gt;
                      &lt;CategoryId&gt;8460&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;grammar&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;Dictionaries&lt;/Name&gt;
                      &lt;CategoryId&gt;8461&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;dictionaries&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                  &lt;/Children&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Text books&lt;/Name&gt;
                  &lt;CategoryId&gt;8462&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;text_books&lt;/GlobalIdentifier&gt;
                  &lt;Children&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;High School&lt;/Name&gt;
                      &lt;CategoryId&gt;8463&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;high_school1&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                    &lt;Category&gt;
                      &lt;Name&gt;University&lt;/Name&gt;
                      &lt;CategoryId&gt;8464&lt;/CategoryId&gt;
                      &lt;GlobalIdentifier&gt;university1&lt;/GlobalIdentifier&gt;
                      &lt;Children/&gt;
                    &lt;/Category&gt;
                  &lt;/Children&gt;
                &lt;/Category&gt;
              &lt;/Children&gt;
            &lt;/Category&gt;
            &lt;Category&gt;
              &lt;Name&gt;Calendars&lt;/Name&gt;
              &lt;CategoryId&gt;8465&lt;/CategoryId&gt;
              &lt;GlobalIdentifier&gt;calendars&lt;/GlobalIdentifier&gt;
              &lt;Children&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Wall calendars&lt;/Name&gt;
                  &lt;CategoryId&gt;8466&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;wall_calendars&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Mini wall calendars&lt;/Name&gt;
                  &lt;CategoryId&gt;8467&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;mini_wall_calendars&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Box calendars&lt;/Name&gt;
                  &lt;CategoryId&gt;8468&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;box_calendars&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
                &lt;Category&gt;
                  &lt;Name&gt;Planners&lt;/Name&gt;
                  &lt;CategoryId&gt;8469&lt;/CategoryId&gt;
                  &lt;GlobalIdentifier&gt;planners&lt;/GlobalIdentifier&gt;
                  &lt;Children/&gt;
                &lt;/Category&gt;
              &lt;/Children&gt;
            &lt;/Category&gt;
        &lt;/Categories&gt;
   &lt;/Body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Categories Object </p>
  
  <pre><code>@XStreamAlias("Categories")
  public class Categories {
      private List&lt;Category&gt; Category;
   }
  </code></pre>
  
  <p>Category Object</p>
  
  <pre><code>@XStreamAlias("Category")
  public class Category {
  
  private String Name;
  private String CategoryId;
  private String GlobalIdentifier;
  private Children Children;
  }
  </code></pre>
  
  <p>Children Object</p>
  
  <pre><code>@XStreamAlias("Children")
  public class Children {
      private List&lt;Category&gt; Category;
  }
  </code></pre>
  
  <p>Parsing : </p>
  
  <pre><code>XStream xs = new XStream();
  xs.autodetectAnnotations(true);
  
  xs.alias("Categories", Categories.class);
  xs.alias("SuccessResponse", CategorySuccessResponse.class);
  
  CategorySuccessResponse successResponse = (CategorySuccessResponse) xs
              .fromXML(response);
  </code></pre>
  
  <p>Error:</p>
  
  <pre><code>---- Debugging information ----
  message             : Name
  cause-exception     :              
  com.thoughtworks.xstream.mapper.CannotResolveClassException
  cause-message       : Name
  class               : java.util.ArrayList
  required-type       : java.util.ArrayList
  converter-type      :     
  com.thoughtworks.xstream.converters.collections.CollectionConverter
  path                : /SuccessResponse/Body/Categories/Category/Name
  line number         : 12
  version             : 1.4.8
  </code></pre>
  
  <p>Whats the cause of this error?</p>