title: Spring data mongodb No mapping metadata found for java.lang.String error
body: <p>I am trying to use spring data mongodb to retrieve a list of collections from the DB. However as soon as my code runs I get the following exception:</p>
  
  <blockquote>
    <p>org.springframework.data.mapping.model.MappingException: No mapping metadata found for java.lang.String
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:209)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readValue(MappingMongoConverter.java:1008)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.access$100(MappingMongoConverter.java:75)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:957)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider.getPropertyValue(MappingMongoConverter.java:924)
        at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:78)
        at org.springframework.data.mapping.model.SpELExpressionParameterValueProvider.getParameterValue(SpELExpressionParameterValueProvider.java:63)
        at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:70)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:232)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:212)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:176)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:172)
        at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:75)</p>
  </blockquote>
  
  <p>I can't seem to find the solution for this anywhere. Any help would be highly appreciated</p>
  
  <p>Here is my java code which is used to retrieve the data:</p>
  
  <pre><code>public List&lt;GateAppointment&gt; listGateAppointments() {
      List&lt;GateAppointment&gt; gateAppointments = null;
      try{
          MongoOperations mongoOperation = (MongoOperations)getMongoTemplate();
          gateAppointments = mongoOperation.findAll(GateAppointment.class,COLLECTION_NAME);
      }
      catch(Exception e){
          e.printStackTrace();
      }
      return gateAppointments;
  }
  </code></pre>
  
  <p>And <code>public static final String COLLECTION_NAME = "gateVisitAppointments";</code></p>
  
  <p>The following is a sample of my DB data(Sorry, cant post image directly as I dont have 10 rep):</p>
  
  <p><a href="http://i40.tinypic.com/35jihll.jpg" rel="noreferrer">Please click to view DB Image</a></p>
  
  <p>Following is my GateAppointment class file properties (The rest of the file has all the setters and getters):</p>
  
  <pre><code>package com.ig.avs.common.entity.db;
  
  public class GateAppointment {
  
  /**
   * The Class GateAppointment.
   * 
   */
  private String gate;
  private String gateAppointmentNbr;
  private String bol;
  private String containerNbr;
  private String iso;
  private String line;
  private String transactionType;
  private String truckingCompany;
  private String truckId;
  private String appoinmentDate;
  private String apSlot;
  private String slotStartTime;
  private String slotEndTime;
  private String isMapped;
  private String status;
  </code></pre>