org.springframework.web.client.RestClientException: Error while extracting response JSON parse error: Cannot deserialize value of type javax.xml.datatype.XMLGregorianCalendar
from String "1983-02-09T00:00:00:000Z": not a valid textual representation, problem: 1983-02-09T00:00:00:000Z; nested exception is com.fasterxml.jackson.databind.exc.InvalidFormatException: Cannot deserialize value of type javax.xml.datatype.XMLGregorianCalendar
from String "1983-02-09T00:00:00:000Z": not a valid textual representation, problem: 1983-02-09T00:00:00:000Z
"dateOfExipre" xml type xsd field as @XmlSchemaType(name = "date") protected XMLGregorianCalendar dateOfExipire; its xsd type class, not able to change this
Asked
Active
Viewed 522 times
2

Sanjay
- 75
- 10
-
How have you declared this property in the POJO? – aksappy Mar 25 '21 at 14:46
-
@XmlSchemaType(name = "date") protected XMLGregorianCalendar dateOfExipire; its xsd type class, not able to change this – Sanjay Mar 25 '21 at 14:47
-
Why do you want an `XMLGregorianCalendar`? That’s an old class. I recommend you use `Instant` or `OffsetDateTime`. Those two classes are from [java.time, the modern Java date and time API](https://docs.oracle.com/javase/tutorial/datetime/). – Ole V.V. Mar 25 '21 at 16:35
-
It’s not my home field, so just guessing: would `@XmlSchemaType(name = "date")` imply that only the date should be in the string, so just `1983-02-09`? – Ole V.V. Mar 25 '21 at 17:05