Skip to content
This repository has been archived by the owner on Dec 18, 2024. It is now read-only.

Dependency of com.xtdb.labs causes conflict #3

Open
MichaelBBTiger opened this issue Feb 9, 2024 · 2 comments
Open

Dependency of com.xtdb.labs causes conflict #3

MichaelBBTiger opened this issue Feb 9, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@MichaelBBTiger
Copy link

When starting the program, the following error will be reported:

clojure.lang.ExceptionInfo: Conflicting data-reader mapping {:url #object[java.net.URL 0x2b4c1d96 "jar:file:/C:/Users/xlawin/.m2/repository/com/xtdb/xtdb-api/2.0.0-SNAPSHOT/xtdb-api-2.0.0-SNAPSHOT.jar!/data_readers.clj"], :conflict xt/runtime-err, :mappings {xt/runtime-err #'xtdb.error/-runtime-err-reader, xt/interval-ym #'xtdb.serde/interval-ym-reader, xt/interval-mdn #'xtdb.serde/interval-mdn-reader, xt.tx/delete #'xtdb.serde/delete-op-reader, xt.tx/sql #'xtdb.serde/sql-op-reader, xt.tx/xtql #'xtdb.serde/xtql-op-reader, xt.tx/erase #'xtdb.serde/erase-op-reader, xt/interval-dt #'xtdb.serde/interval-dt-reader, xt/period-duration #'xtdb.serde/period-duration-reader, xt/tx-key #'xtdb.serde/tx-key-read-fn, xt.tx/put #'xtdb.serde/put-op-reader, xt/illegal-arg #'xtdb.error/-iae-reader, xt.arrow/type #'xtdb.types/->arrow-type, xt.tx/call #'xtdb.serde/call-op-reader, xt/clj-form #'xtdb.api/->ClojureForm}}

I found that when the dependency is replaced with the com.xtdb/xtdb-api library (like https://github.com/xtdb/sakila-playground), it works fine.

;; for testing only - run XTDB as a server for production(!)
;; com.xtdb.labs/xtdb-core {:mvn/version "2.0.0-SNAPSHOT"}
;; com.xtdb.labs/xtdb-http-server {:mvn/version "2.0.0-SNAPSHOT"}
;; com.xtdb.labs/xtdb-pgwire-server {:mvn/version "2.0.0-SNAPSHOT"}

;; XTDB API and http client
;; com.xtdb.labs/xtdb-api {:mvn/version "2.0.0-SNAPSHOT"}
;; com.xtdb.labs/xtdb-http-client-clj {:mvn/version "2.0.0-SNAPSHOT"}

;; works fine
com.xtdb/xtdb-api {:mvn/version "2.0.0-SNAPSHOT"}
com.xtdb/xtdb-core {:mvn/version "2.0.0-SNAPSHOT"}
com.xtdb/xtdb-http-server {:mvn/version "2.0.0-SNAPSHOT"}

@refset
Copy link
Contributor

refset commented Feb 9, 2024

Hi @MichaelBBTiger thanks for the report, and for persevering to find the fix! I can confirm that the com.xtdb.labs namespace is now considered deprecated (at least as far as the core of v2 is concerned) - apologies for the confusion - we'll tidy up the examples in due course 🙂

@refset refset added the bug Something isn't working label Feb 9, 2024
@justone
Copy link

justone commented Feb 22, 2024

I hit this as well, thank you for showing a fix.

I also had to change the submit-tx code to this, and then the rest of the Clojure/Clerk code worked well:

(xt/submit-tx my-node (concat
                       (for [doc my-persons]
                         [:put-docs :persons doc])
                       (for [doc my-movies]
                         [:put-docs :movies doc])))

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants