xtdb icon indicating copy to clipboard operation
xtdb copied to clipboard

Unfreezable type: class java.time.Instant

Open altfatterz opened this issue 4 years ago • 1 comments

I am using crux version 20.03-1.7.1-alpha Do I have to set serialisation guidance to Nippy to properly serialise java.time.Instant? How to do that?

clojure.lang.ExceptionInfo: Unfreezable type: class java.time.Instant
    at taoensso.nippy$throw_unfreezable.invokeStatic(nippy.clj:720) ~[?:?]
    at taoensso.nippy$throw_unfreezable.invoke(nippy.clj:718) ~[?:?]
    at taoensso.nippy$eval18952$fn__18953.invoke(nippy.clj:924) ~[?:?]
    at taoensso.nippy$eval18649$fn__18650$G__18640__18657.invoke(nippy.clj:314) ~[?:?]
    at taoensso.nippy$eval18704$fn__18705.invoke(nippy.clj:331) ~[?:?]
    at taoensso.nippy$eval18677$fn__18678$G__18668__18685.invoke(nippy.clj:315) ~[?:?]
    at taoensso.nippy$write_kvs$fn__18748$fn__18749.invoke(nippy.clj:503) ~[?:?]
    at taoensso.nippy$write_kvs$fn__18748.invoke(nippy.clj:500) ~[?:?]
    at clojure.core$eval3826$fn__3827$fn__3829.invoke(core.clj:6840) ~[?:?]
    at clojure.core.protocols$iter_reduce.invokeStatic(protocols.clj:49) ~[?:?]
    at clojure.core.protocols$iter_reduce.invoke(protocols.clj:33) ~[?:?]
    at clojure.core.protocols$eval3401$fn__3402.invoke(protocols.clj:112) ~[?:?]
    at clojure.core.protocols$eval3327$fn__3328$G__3318__3341.invoke(protocols.clj:13) ~[?:?]
    at clojure.core$reduce.invokeStatic(core.clj:6828) ~[?:?]
    at clojure.core$reduce.invoke(core.clj:6810) ~[?:?]
    at clojure.core$eval3826$fn__3827.invoke(core.clj:6840) ~[?:?]
    at clojure.core.protocols$eval3452$fn__3453$G__3443__3462.invoke(protocols.clj:175) ~[?:?]
    at clojure.core$reduce_kv.invokeStatic(core.clj:6856) ~[?:?]
    at clojure.core$reduce_kv.invoke(core.clj:6847) ~[?:?]
    at taoensso.nippy$write_kvs.invokeStatic(nippy.clj:500) ~[?:?]
    at taoensso.nippy$write_kvs.invoke(nippy.clj:495) ~[?:?]
    at taoensso.nippy$eval18920$fn__18921.invoke(nippy.clj:881) ~[?:?]
    at taoensso.nippy$eval18649$fn__18650$G__18640__18657.invoke(nippy.clj:314) ~[?:?]
    at taoensso.nippy$eval18696$fn__18697.invoke(nippy.clj:323) ~[?:?]
    at taoensso.nippy$eval18677$fn__18678$G__18668__18685.invoke(nippy.clj:315) ~[?:?]
    at taoensso.nippy$fast_freeze$fn__18973.invoke(nippy.clj:955) ~[?:?]
    at taoensso.nippy$fast_freeze.invokeStatic(nippy.clj:955) ~[?:?]
    at taoensso.nippy$fast_freeze.invoke(nippy.clj:944) ~[?:?]
    at crux.codec$eval19768$fn__19769.invoke(codec.clj:287) ~[?:?]
    at crux.codec$eval19608$fn__19609$G__19599__19616.invoke(codec.clj:85) ~[?:?]
    at crux.codec$eval19823$fn__19824.invoke(codec.clj:355) ~[?:?]
    at crux.codec$eval19571$fn__19583$G__19562__19588.invoke(codec.clj:81) ~[?:?]
    at crux.codec$eval19823$fn__19826.invoke(codec.clj:358) ~[?:?]
    at crux.codec$eval19571$fn__19572$G__19560__19577.invoke(codec.clj:81) ~[?:?]
    at crux.tx$tx_ops__GT_id_and_docs$fn__31133.invoke(tx.clj:62) ~[?:?]
    at clojure.core$map$fn__599.invoke(core.clj:2753) ~[?:?]
    at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[?:?]
    at clojure.lang.LazySeq.seq(LazySeq.java:51) ~[?:?]
    at clojure.lang.RT.seq(RT.java:535) ~[?:?]
    at clojure.core$seq__27.invokeStatic(core.clj:137) ~[?:?]
    at clojure.core$seq__27.invoke(core.clj:137) ~[?:?]
    at crux.object_store.CachedObjectStore$iter__28419__28423$fn__28424.invoke(object_store.clj:105) ~[?:?]
    at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[?:?]
    at clojure.lang.LazySeq.seq(LazySeq.java:51) ~[?:?]
    at clojure.lang.RT.seq(RT.java:535) ~[?:?]
    at clojure.core$seq__27.invokeStatic(core.clj:137) ~[?:?]
    at clojure.core$seq__27.invoke(core.clj:137) ~[?:?]
    at crux.object_store.KvObjectStore$iter__28304__28308$fn__28309.invoke(object_store.clj:43) ~[?:?]
    at clojure.lang.LazySeq.sval(LazySeq.java:42) ~[?:?]
    at clojure.lang.LazySeq.seq(LazySeq.java:51) ~[?:?]
    at clojure.lang.RT.seq(RT.java:535) ~[?:?]
    at clojure.core$seq__27.invokeStatic(core.clj:137) ~[?:?]
    at clojure.core$seq__27.invoke(core.clj:137) ~[?:?]
    at crux.kv.rocksdb.RocksKv.store(rocksdb.clj:111) ~[?:?]
    at crux.lru.CacheProvidingKvStore.store(lru.clj:139) ~[?:?]
    at crux.object_store.KvObjectStore.put_objects(object_store.clj:43) ~[?:?]
    at crux.object_store.CachedObjectStore.put_objects(object_store.clj:105) ~[?:?]
    at crux.standalone.StandaloneDocumentStore.submit_docs(standalone.clj:133) ~[?:?]
    at crux.node.CruxNode.submitTx(node.clj:107) ~[?:?]

altfatterz avatar Apr 02 '20 13:04 altfatterz

Hey @altfatterz, thanks for getting in touch :)

Yes - you can extend Nippy's serialisation/deserialisation using its extend-freeze and extend-thaw macros. Alternatively, java.util.Date is natively supported, if conversion is an option?

jarohen avatar Apr 02 '20 13:04 jarohen