1

I keep getting following exception while reading data from cache.

org.springframework.data.redis.serializer.SerializationException: Could not read JSON: Cannot construct instance of `java.time.Instant` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

It started as soon as I introduced new variable of type java.time.Instant

jprogrammer
  • 33
  • 1
  • 5

1 Answers1

0

You can use JsonSerializer and JsonDeserializer to serialize Instant object either as milliseconds or custom text format.

For example implementation follow the answer section of How to set format of string for java.time.Instant using objectMapper?

tabreaz
  • 649
  • 4
  • 17