If I use LocalDate type in my entity class I get the following error if I send a POST request:
com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time.LocalDate` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('1977-01-01')
at [Source: (io.undertow.servlet.spec.ServletInputStreamImpl); line: 1, column: 533]
If I change my attribute type from
@JsonbDateFormat("yyyy-MM-dd")
private java.time.LocalDate mydate;
to
@JsonbDateFormat("yyyy-MM-dd")
private java.util.Date mydate;
it works!
I have tested with Wildfly 15 and 16 (Eclipse Yasson implementation) and the new Java date classes doesn't seem to work with JSON-Bindings.
Is this not supported or do I something wrong?