title: How to setup LocalDateTime in Spring XML configuration
body: <p>My problem relates to the following class:</p>
  
  <pre><code>public class MyClass {
      private LocalDateTime startDate;
  }
  </code></pre>
  
  <p>I am trying to setup the startDate property of this bean using Spring XML configuration:</p>
  
  <pre><code>&lt;property name="startDate"&gt;
     &lt;value&gt;2000-01-01&lt;/value&gt;
  &lt;/property&gt;
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>Cannot convert value of type [java.lang.String] to required type [java.time.LocalDateTime] for property 'startDate'
  </code></pre>
  
  <p>Is it possible to use Spring to do this conversion? I found examples on the <a href="http://examples.javacodegeeks.com/enterprise-java/spring/beans-spring/spring-inject-date-into-bean-property-with-customdateeditor/" rel="nofollow">net</a> how to do that for Date object, however, LocalDateTime doesn't have a constructor taking a string (and the solution seems to need such constructor). LocalDateTime is constructed by using the static method LocalDateTime.parse.</p>
  
  <p>Using the annotations @DateTimeFormat, like:</p>
  
  <pre><code>public class MyClass {
      @DateTimeFormat(iso=ISO.LOCAL_DATE_TIME)
      private LocalDateTime startDate;
  }
  </code></pre>
  
  <p>is not a solution, since MyClass has to be available outside Spring.</p>
  
  <p>Thanks in advance</p>