As @PaulSamsotha pointed out, I need to register the JacksonJsonProvider on the client side too:

ClientConfig cc = new DefaultClientConfig();
cc.getSingletons().add(ShopApplication.newJacksonJsonProvider());
wr = Client.create(cc).resource(Main.BASE_URI.resolve("products"));

which contains the customized solution:

private static JacksonJsonProvider newJacksonJsonProvider() {
  ObjectMapper mapper =
      new ObjectMapper()
          .registerModule(new ParameterNamesModule())
          .registerModule(new Jdk8Module())
          .registerModule(new JavaTimeModule()); // new module, NOT JSR310Module
  mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
  mapper.setDateFormat(new StdDateFormat());
  return new JacksonJsonProvider(mapper);
}
Answer from Mincong Huang on Stack Overflow
🌐
Oracle
docs.oracle.com › javase › 8 › docs › api › java › time › ZonedDateTime.html
ZonedDateTime (Java Platform SE 8 )
July 21, 2026 - The zone and offset will be set based on the time-zone in the clock. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using dependency injection. ... Obtains an instance of ZonedDateTime from a local date and time.
🌐
GitHub
github.com › FasterXML › jackson-modules-java8 › issues › 167
ZonedDateTime can't be deserialized · Issue #167 · FasterXML/jackson-modules-java8
March 23, 2020 - I'm using spring boot 2.2.5 and I tried to deserialized ZonedDateTime provided by AWS SQS and got the same exception. the date format I got from amazon as 2020-03-23T09:21:00.353Z · and the exception Could not read JSON: Cannot construct instance of `java.time.ZonedDateTime` (no Creators, like default construct, exist): no String-argument constructor/factory method to deserialize from String value ('2020-03-23T09:21:00.353Z')
Author: FasterXML
🌐
Stack Overflow
stackoverflow.com › questions › linked › 45863678
Hot Linked Questions - Stack Overflow
I am trying to create reservation and I am getting a java.time.LocalDate error like below. com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `java.time....
Top answer
1 of 5
82

This does not work because your input (and your Formatter) do not have time zone information. A simple way is to parse your date as a LocalDate first (without time or time zone information) then create a ZonedDateTime:

public static ZonedDateTime convertirAFecha(String fecha) {
  DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy");
  LocalDate date = LocalDate.parse(fecha, formatter);

  ZonedDateTime resultado = date.atStartOfDay(ZoneId.systemDefault());
  return resultado;
}
2 of 5
18

This is a bug, see JDK-bug-log. According to that information the problem was solved for Java 9 and Java 8u20. Try to download the latest Java 8 - version. Today on 2014-05-12: There is an early access release 8u20 available.

UPDATE:

Personally I think, since you only have and expect "dd/MM/yyyy" as pattern you should use LocalDate as your primary type as @assylias has already proposed. Regarding your context, it is almost sure a design failure to use ZonedDateTime. What do you want to do with objects of this type? I can only think of specialized timezone calculations as use-case. And you cannot even directly store these ZonedDateTime-objects in a database, so this type is far less useful than many people believe.

What I described as your use-case problem is indeed a new aspect introduced with Java-8 compared with the old GregorianCalendar-class (which is an all-in-one-type). Users have to start thinking about choosing the proper temporal type for their problems and use-cases.

🌐
GitHub
github.com › joelittlejohn › jsonschema2pojo › issues › 1309
ZonedDateTime · Issue #1309 · joelittlejohn/jsonschema2pojo
August 23, 2021 - <plugin> <groupId>org.jsonschema2pojo</groupId> <artifactId>jsonschema2pojo-maven-plugin</artifactId> <version>1.1.1</version> <executions> <execution> <id>search</id> <phase> generate-sources </phase> <goals> <goal>generate</goal> </goals> <configuration> <generateBuilders>true</generateBuilders> <useLongIntegers>true</useLongIntegers> <formatDateTimes>true</formatDateTimes> <customDateTimePattern>yyyy-MM-dd'T'HH:mm:ss[.SSSSSSS]'Z'</customDateTimePattern> <dateTimeType>java.time.ZonedDateTime</dateTimeType> <dateType>java.time.LocalDate</dateType> </configuration> </execution> </executions> </plugin> ... Cannot construct instance of `java.time.ZonedDateTime` (no Creators, like default constructor, exist): no String-argument constructor/factory method to deserialize from String value ('2021-08-02T15:44:21.0000000Z')
Author: joelittlejohn
Find elsewhere
🌐
Oracle
docs.oracle.com › javase › 9 › docs › api › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 9 & JDK 9 )
The zone and offset will be set based on the time-zone in the clock. Using this method allows the use of an alternate clock for testing. The alternate clock may be introduced using dependency injection. ... Obtains an instance of ZonedDateTime from a local date and time.
🌐
Dariawan
dariawan.com › tutorials › java › java-zoneddatetime-tutorial-examples
Java ZonedDateTime Tutorial with Examples | Dariawan
August 27, 2019 - static ZonedDateTime of(LocalDateTime localDateTime, ZoneId zone): Obtains an instance of ZonedDateTime from a local date-time.
🌐
Oracle
docs.oracle.com › en › java › javase › 24 › docs › api › java.base › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 24 & JDK 24)
July 15, 2025 - Obtains an instance of ZonedDateTime from a text string using a specific formatter. ... Returns a copy of this date-time with the specified amount added.
🌐
Oracle
docs.oracle.com › en › java › javase › 20 › docs › api › java.base › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 20 & JDK 20)
July 10, 2023 - Obtains an instance of ZonedDateTime from a text string using a specific formatter. ... Returns a copy of this date-time with the specified amount added.
🌐
Oracle
docs.oracle.com › en › java › javase › 23 › docs › api › java.base › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 23 & JDK 23)
October 17, 2024 - Obtains an instance of ZonedDateTime from a text string using a specific formatter. ... Returns a copy of this date-time with the specified amount added.
🌐
Javatpoint
javatpoint.com › java-zoneddatetime
Java ZonedDateTime Class
Class class is part of the java.time package which is added to the Java 8 release as the Java Date and Time API (also known as JSR-310). The date and time are brought together in this class without having timezone information.
🌐
Oracle
docs.oracle.com › en › java › javase › 17 › docs › api › java.base › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 17 & JDK 17)
April 21, 2026 - The offset cannot be freely set, as the zone controls which offsets are valid. This class is immutable and thread-safe. ... Checks if this date-time is equal to another date-time. ... Formats this date-time using the specified formatter. ... Obtains an instance of ZonedDateTime from a temporal object.
🌐
Oracle
docs.oracle.com › en › java › javase › 25 › docs › › api › java.base › java › time › ZonedDateTime.html
ZonedDateTime (Java SE 25 & JDK 25)
July 21, 2026 - The offset cannot be freely set, as the zone controls which offsets are valid. This class is immutable and thread-safe. ... Checks if this date-time is equal to another date-time. ... Formats this date-time using the specified formatter. ... Obtains an instance of ZonedDateTime from a temporal object.
🌐
Baeldung
baeldung.com › home › json › jackson › jackson date
Jackson Date | Baeldung
May 11, 2024 - 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 ('2014-12-20') at [Source: (String)"2014-12-20"; line: 1, column: 1]