title: use of GeoJsonPoint with mongoDB and spring data
body: <p>I tried hard to build an example to save my enity like below:</p>
  
  <p>Resource class has ResourceDetail in which I defined GeoJsonPoint.<br></p>
  
  <pre><code>@Document(collection = "Resource")
  public class Resource implements Serializable {
  
      /**
       * 
       */
      private static final Long serialVersionUID = 1L;
  
      @Id
      private Long id;
      private String name;
      private Integer age;
      private String orgName;
      private String resourceType;
      private String department;
      private boolean showPrice;
      private Integer price;
      private ResourceDetail resourceDetail;
  }
  
  
  
  @Document(collection = "ResourceDetail")
  public class ResourceDetail implements Serializable {
  
      /**
       * 
       */
      private static final long serialVersionUID = 1L;
  
      private String identityNumber;
      @DateTimeFormat(iso = ISO.DATE)
      private Date birthDate;
      private String addressLine1;
      private String addressLine2;
      private String specialization;
      private GeoJsonPoint location;
  }
  </code></pre>
  
  <p>I have added following mapper also in Appconfig:<br></p>
  
  <pre><code>@Configuration
  @ComponentScan(basePackages = "com.test")
  @EnableWebMvc
  public class AppConfig extends WebMvcConfigurerAdapter {
      @Bean
      public MongoDbFactory mongoDbFactory() throws Exception {
          return new SimpleMongoDbFactory(new MongoClient(), "test");
      }
      @Bean
      public MongoTemplate mongoTemplate() throws Exception {
          MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory());
          return mongoTemplate;
      }
      /**
       * Read JSON data from disk and insert those stores.
       * 
       * @return
       */
      public @Bean ObjectMapper repositoryPopulator() {
          ObjectMapper mapper = new ObjectMapper();
          mapper.addMixIn(GeoJsonPoint.class, GeoJsonPointMixin.class);
          mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
          return mapper;
      }
      static abstract class GeoJsonPointMixin {
          GeoJsonPointMixin(@JsonProperty("longitude") double x, @JsonProperty("latitude") double y) {
          }
      }
  }
  </code></pre>
  
  <p>I am getting this error:<br></p>
  
  <pre><code>{
      "timestamp": 1445857673601,
      "status": 400,
      "error": "Bad Request",
      "exception": "org.springframework.http.converter.HttpMessageNotReadableException",
      "message": "Could not read JSON: No suitable constructor found for type [simple type, class org.springframework.data.mongodb.core.geo.GeoJsonPoint]: can not instantiate from JSON object (need to add/enable type information?)\n at [Source: java.io.PushbackInputStream@d7eff8; line: 13, column: 25] (through reference chain: com.appointment.domain.Resource[\"resourceDetail\"]-&gt;com.appointment.domain.ResourceDetail[\"location\"]); nested exception is com.fasterxml.jackson.databind.JsonMappingException: No suitable constructor found for type [simple type, class org.springframework.data.mongodb.core.geo.GeoJsonPoint]: can not instantiate from JSON object (need to add/enable type information?)\n at [Source: java.io.PushbackInputStream@d7eff8; line: 13, column: 25] (through reference chain: com.appointment.domain.Resource[\"resourceDetail\"]-&gt;com.appointment.domain.ResourceDetail[\"location\"])",
      "path": "/rest/resource/add"
  }
  </code></pre>
  
  <p>I used this format to save my enity with GeoJsonPoint:</p>
  
  <pre><code>{
  
    "name":"Test",
    "age": 32,
    "orgName":"testOrg",
    "resourceType":"testresourcType",
    "price":1200,
    "department":"testDepartment",
    "resourceDetail": {
                      "identityNumber": "3",
                      "birthDate": "2000-10-10",
      "location" : { "latitude":40.743827, "longitude":-73.989015 }
  
  }
  </code></pre>
  
  <p>Please help me to solve this. Thanks</p>