ElasticSearch Java Client and OffestDateTime

Hi,

I updated my elasticsearch java client from 6.2.4 to 6.4. Now I got an exception

Exception in thread "main" java.lang.IllegalArgumentException: cannot write xcontent for unknown value of type class java.time.OffsetDateTime
at org.elasticsearch.common.xcontent.XContentBuilder.unknownValue(XContentBuilder.java:755)
at org.elasticsearch.common.xcontent.XContentBuilder.value(XContentBuilder.java:726)
at org.elasticsearch.common.xcontent.XContentBuilder.field(XContentBuilder.java:711)

Is there a way to register OffsetTimeDeserializer or am I doing something completely wrong.

Which 6.4 version are you using exactly? I remember a fix around that in 6.4.1, see https://github.com/elastic/elasticsearch/pull/33120/files

I was using 6.4.0, a minor version bump fixed it. Thanks

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.