title: JSON Jackson ObjectMapper ReadValue - Error in converting date
body: <p>I am seeing the error listed below when trying to convert the json string to an object.  I don't have the source code for Data class &amp; it is part of a jar file. Is there a way I could use mixins to get this fixed?</p>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>ObjectMapper mapper = new ObjectMapper();
  mapper.readValue(request, Data.class);
  </code></pre>
  
  <p><strong>ERROR</strong></p>
  
  <blockquote>
    <p>org.codehaus.jackson.map.JsonMappingException: Can not construct
    instance of javax.xml.datatype.XMLGregorianCalendar from String value
    '10:00:00': not a valid representation (error: Can not parse date
    "10:00:00": not compatible with any of standard forms
    ("yyyy-MM-dd'T'HH:mm:ss.SSSZ", "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE,
    dd MMM yyyy HH:mm:ss zzz", "yyyy-MM-dd"))</p>
  </blockquote>
  
  <p><strong>JSON REQUEST</strong></p>
  
  <pre><code> "timeSlot":{  
         "date":"2015-10-21",
         "endTime":"10:00:00",
         "startTime":"08:00:00",   
   }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This issue is similar to <a href="https://stackoverflow.com/questions/33020144/retain-xmlgregoriancalendar-date-format-after-converting-to-json-jackson-lib">this</a> , however this is occuring while deserializing. The other solution helped in appropriately serializing the request.</p>
  
  <p>I have pasted the sample code which is not working below -</p>
  
  <pre><code>import java.io.IOException;
  import java.text.DateFormat;
  import java.text.ParseException;
  import java.text.SimpleDateFormat;
  import java.util.Calendar;
  import java.util.Date;
  import java.util.GregorianCalendar;
  
  import javax.xml.datatype.DatatypeConfigurationException;
  import javax.xml.datatype.DatatypeConstants;
  import javax.xml.datatype.DatatypeFactory;
  import javax.xml.datatype.XMLGregorianCalendar;
  
  import com.fasterxml.jackson.core.JsonParseException;
  import com.fasterxml.jackson.core.JsonProcessingException;
  import com.fasterxml.jackson.databind.JsonMappingException;
  import com.fasterxml.jackson.databind.ObjectMapper;
  import com.fasterxml.jackson.databind.SerializationFeature;
  
  public class TestJSONDeserialize {
  
      public static void main(String[] args){
  
          ObjectMapper mapper = new ObjectMapper();
          mapper.addMixIn(Data.class, MyMixin.class);
  
          String jsonString = "{\"date\":\"2014-02-10\",\"time\":\"16:15:00\"}";
          try {
              mapper.readValue(jsonString, Data.class);
          } catch (JsonParseException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (JsonMappingException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          } catch (IOException e) {
              // TODO Auto-generated catch block
              e.printStackTrace();
          }
  
      }
  
  
  }
  </code></pre>
  
  <p><strong>Data class (I cannot make changes to this file)</strong></p>
  
  <pre><code>import javax.xml.datatype.XMLGregorianCalendar;
  
  public class Data {
  
      private XMLGregorianCalendar date;
      private XMLGregorianCalendar time;
  
      public XMLGregorianCalendar getDate() {
          return date;
      }
      public void setDate(XMLGregorianCalendar date) {
          this.date = date;
      }
      public XMLGregorianCalendar getTime() {
          return time;
      }
      public void setTime(XMLGregorianCalendar time) {
          this.time = time;
      }
  
  
  
  }
  </code></pre>
  
  <p>I see the below error when I run this :</p>
  
  <blockquote>
    <p>com.fasterxml.jackson.databind.exc.InvalidFormatException: Can not
    construct instance of javax.xml.datatype.XMLGregorianCalendar from
    String value '16:15:00': not a valid representation (error: Failed to
    parse Date value '16:15:00': Can not parse date "16:15:00": not
    compatible with any of standard forms ("yyyy-MM-dd'T'HH:mm:ss.SSSZ",
    "yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", "EEE, dd MMM yyyy HH:mm:ss zzz",
    "yyyy-MM-dd"))  at [Source: {"date":"2014-02-10","time":"16:15:00"};
    line: 1, column: 21] (through reference chain:
    com.comcast.json.test.Data["time"])</p>
  </blockquote>