Reopening MongoDB issue: java.lang.IllegalArgumentException: can't serialize class java.time.ZonedDateTime

Tags: #<Tag:0x00007f432fadca18>

Dear community,

Just restarting a topic first mentioned here:

Hitting exactly the same problem after migration to OH3 and migrating off mysql.
Tried a couple of different regional settings (Canada, US, metric, imperial) - same result…
Did anybody managed to get MongoDB working? Could you share strategies?
I am a bit stuck here trying to get any persistence working in OH3…

[ERROR] [internal.JSONResponseExceptionMapper] - Unexpected exception occurred while processing REST request.
java.lang.IllegalArgumentException: can't serialize class java.time.ZonedDateTime
	at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:299) ~[?:?]
	at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194) ~[?:?]
	at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:255) ~[?:?]
	at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194) ~[?:?]
	at org.bson.BasicBSONEncoder._putObjectField(BasicBSONEncoder.java:255) ~[?:?]
	at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:194) ~[?:?]
	at org.bson.BasicBSONEncoder.putObject(BasicBSONEncoder.java:136) ~[?:?]
	at com.mongodb.DefaultDBEncoder.writeObject(DefaultDBEncoder.java:36) ~[?:?]
	at com.mongodb.OutMessage.putObject(OutMessage.java:289) ~[?:?]
	at com.mongodb.OutMessage.writeQuery(OutMessage.java:211) ~[?:?]
	at com.mongodb.OutMessage.query(OutMessage.java:86) ~[?:?]
	at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:81) ~[?:?]
	at com.mongodb.DBCollectionImpl.find(DBCollectionImpl.java:66) ~[?:?]
	at com.mongodb.DBCursor._check(DBCursor.java:498) ~[?:?]
	at com.mongodb.DBCursor._hasNext(DBCursor.java:621) ~[?:?]
	at com.mongodb.DBCursor.hasNext(DBCursor.java:657) ~[?:?]
	at org.openhab.persistence.mongodb.internal.MongoDBPersistenceService.query(MongoDBPersistenceService.java:293) ~[?:?]
	...