title: Why do I get a "No property node found on entity class … to bind constructor parameter to!" with Spring Data MongoDB
body: <p>Trying to use JodaTime's <code>LocalDate</code> with Spring Data MongoDB and Spring 4 but I am getting the following exception:</p>
  
  <pre><code>SEVERE: Servlet.service() for servlet [dispatcher] in context with path [] threw exception [Request processing failed; nested exception is org.springframework.data.mapping.model.MappingException: No property node found on entity class com.th.model.Price to bind constructor parameter to!] with root cause
  org.springframework.data.mapping.model.MappingException: No property node found on entity class com.th.model.Price to bind constructor parameter to!
      at org.springframework.data.mapping.model.PersistentEntityParameterValueProvider.getParameterValue(PersistentEntityParameterValueProvider.java:74)
      at org.springframework.data.mapping.model.SpELExpressionParameterValueProvider.getParameterValue(SpELExpressionParameterValueProvider.java:63)
      at org.springframework.data.convert.ReflectionEntityInstantiator.createInstance(ReflectionEntityInstantiator.java:71)
      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:249)
      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:230)
      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:190)
      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:186)
      at org.springframework.data.mongodb.core.convert.MappingMongoConverter.read(MappingMongoConverter.java:77)
      at org.springframework.data.mongodb.core.MongoTemplate$ReadDbObjectCallback.doWith(MongoTemplate.java:2121)
      at org.springframework.data.mongodb.core.MongoTemplate.executeFindMultiInternal(MongoTemplate.java:1805)
      at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1628)
      at org.springframework.data.mongodb.core.MongoTemplate.doFind(MongoTemplate.java:1611)
      at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:535)
      at org.springframework.data.mongodb.core.MongoTemplate.find(MongoTemplate.java:526)
      at com.th.model.Company.getPrices(Company.java:255)
      at com.th.controller.Home.getPrices(Home.java:32)
      …
  </code></pre>
  
  <p>Here my configuration:</p>
  
  <pre><code>&lt;mongo:db-factory id="mongoDbFactory" dbname="th" host="localhost"/&gt;
  
  &lt;mongo:mapping-converter id="mappingConverter"&gt;
      &lt;mongo:custom-converters&gt;
      &lt;mongo:converter&gt;
          &lt;bean class="com.th.tool.MongoDBConverters.DateToLocalDateConverter"/&gt;
      &lt;/mongo:converter&gt;
      &lt;mongo:converter&gt;
          &lt;bean class="com.th.tool.MongoDBConverters.LocalDateToDateConverter"/&gt;
      &lt;/mongo:converter&gt;
      &lt;/mongo:custom-converters&gt;
  &lt;/mongo:mapping-converter&gt;
  
  
  &lt;bean class="org.springframework.data.mongodb.core.MongoTemplate"&gt;
      &lt;constructor-arg name="mongoDbFactory" ref="mongoDbFactory"/&gt;
      &lt;constructor-arg name="mongoConverter" ref="mappingConverter"/&gt;
  &lt;/bean&gt;
  </code></pre>
  
  <hr>
  
  <pre><code>public class MongoDBConverters {
  
      public static class DateToLocalDateConverter implements Converter&lt;Date, LocalDate&gt; {
  
          @Override
          public LocalDate convert(Date source) {
              return source == null ? null : LocalDate.fromDateFields(source);
          }
      }
  
      public static class LocalDateToDateConverter implements Converter&lt;LocalDate, Date&gt; {
  
          @Override
          public Date convert(LocalDate source) {
              return source == null ? null : source.toDate();
          }
      }
  }
  </code></pre>