title: Can't construct a java object for tag:yaml.org,2002:
body: <p>When I am trying to create an object from a data file, I am getting the following exception while <code>assest</code> class is present. I have tried with dum; it was able to dump the data but when I have tried to read same data I am getting the following exception:</p>
  
  <pre><code> [ConstructorException: null; Can't construct a java object for tag:yaml.org,2002:model.Asset; exception=Class not found: model.Asset]
  </code></pre>
  
  <p>File reader:</p>
  
  <pre><code>package utill;
  
  import org.yaml.snakeyaml.Yaml;
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.*;
  import java.io.InputStream;
  import java.util.*;
  import model.*;
  import java.util.LinkedHashMap;
  import org.yaml.snakeyaml.constructor.Constructor;
  
  
  public class FileReaderUtill  {
  
      public static List getAssest(String fileName){
          LinkedHashMap&lt;String,Asset&gt; assest=null;
          List&lt;Asset&gt; data= new ArrayList&lt;Asset&gt;();
          try{
              InputStream input = new FileInputStream(new 
              File("conf/datafile.yaml"));
              Yaml yaml = new Yaml();
  
              data=(List&lt;Asset&gt;)yaml.load(input);
  
              //System.out.println(assest.get("Asset0"));
          }catch(IOException e){
               e.printStackTrace();
          }
      return data;
      }
  }
  </code></pre>
  
  <p>Datafile.yaml</p>
  
  <pre><code>- !!model.Asset {cid: null, enable: '1', id: re, internalName: df, name: fd}
  - !!model.Asset {cid: null, enable: '0', id: rexz, internalName: dxxf, name: fdxxx}
  </code></pre>
  
  <p>Assest.java</p>
  
  <pre><code>package model;
  
  
  public class Asset  {
      public Asset(){
      }
      public Asset(String id,String cid,String name,String internalName,String enable ){
          this.id=id;
          this.name=name;
          this.internalName=internalName;
          this.enable=enable;
      }
  
      public String id;
      public String cid;
      public String name;
      public String internalName;
      public String enable;   
  
  }
  </code></pre>
  
  <p>Please help me solve this issue.</p>