Fork me on GitHub
#datalevin
<
2022-09-09
>
2FO00:09:34

Hello, I'm running into this error: Could not initialize class org.lmdbjava.ByteBufferProxy on linux: Clojure CLI version 1.11.1.1113 openjdk 17.0.4 2022-07-19 whilst attempting to recreate the examples in the readme. Following issue: https://github.com/juji-io/datalevin/issues/73 , I added the following the jvm-opts to deps.edn without success. deps.edn

{:paths ["src"]
 :deps {ring/ring {:mvn/version "1.9.5"}
        datalevin/datalevin {:mvn/version "0.6.17"}
        rum/rum   {:mvn/version "0.12.9" :exclusions
                   [cljsjs/react cljsjs/react-dom]}}
 :jvm/base {:jvm-opts ["-J--add-opens=java.base/java.nio=ALL-UNNAMED"
                       "-J--add-opens=java.base/sun.nio.ch=ALL-UNNAMED"]}}
Evaluated code:
(ns min.datal
  (:require [datalevin.core :as d]))

(def schema ....

(def conn (d/get-conn "/tmp/datalevin/mydb" schema))

(d/transact! conn....

(d/q '[:find ?nation...
     
Stacktrace:
2. Unhandled clojure.lang.Compiler$CompilerException
   Error compiling datal.clj at (8:11)
   #:clojure.error{:phase :execution, :line 8, :column 11, :source "datal.clj"}
             Compiler.java: 3719  clojure.lang.Compiler$InvokeExpr/eval
             Compiler.java:  457  clojure.lang.Compiler$DefExpr/eval
             Compiler.java: 7199  clojure.lang.Compiler/eval
             Compiler.java: 7653  clojure.lang.Compiler/load
                      REPL:    1  user/eval17751
                      REPL:    1  user/eval17751
             Compiler.java: 7194  clojure.lang.Compiler/eval
             Compiler.java: 7149  clojure.lang.Compiler/eval
                  core.clj: 3215  clojure.core/eval
                  core.clj: 3211  clojure.core/eval
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  667  clojure.core/apply
                  core.clj: 1990  clojure.core/with-bindings*
                  core.clj: 1990  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn
                  main.clj:  437  clojure.main/repl/read-eval-print/fn
                  main.clj:  437  clojure.main/repl/read-eval-print
                  main.clj:  458  clojure.main/repl/fn
                  main.clj:  458  clojure.main/repl
                  main.clj:  368  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   84  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   56  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  152  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  218  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  217  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  833  java.lang.Thread/run

1. Caused by java.lang.NoClassDefFoundError
   Could not initialize class org.lmdbjava.ByteBufferProxy

                  Env.java:   92  org.lmdbjava.Env/create
                  java.clj:  605  datalevin.binding.java/eval12438/fn
              MultiFn.java:  234  clojure.lang.MultiFn/invoke
              storage.cljc:  597  datalevin.storage$open/invokeStatic
              storage.cljc:  584  datalevin.storage$open/invoke
                   db.cljc:  312  datalevin.db$open_store/invokeStatic
                   db.cljc:  304  datalevin.db$open_store/invoke
                   db.cljc:  335  datalevin.db$empty_db/invokeStatic
                   db.cljc:  328  datalevin.db$empty_db/invoke
                 core.cljc:  511  datalevin.core$create_conn/invokeStatic
                 core.cljc:  473  datalevin.core$create_conn/invoke
                 core.cljc:  761  datalevin.core$new_conn/invokeStatic
                 core.cljc:  759  datalevin.core$new_conn/invoke
                 core.cljc:  776  datalevin.core$get_conn/invokeStatic
                 core.cljc:  765  datalevin.core$get_conn/invoke
                 core.cljc:  772  datalevin.core$get_conn/invokeStatic
                 core.cljc:  765  datalevin.core$get_conn/invoke
                  AFn.java:  156  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
             Compiler.java: 3714  clojure.lang.Compiler$InvokeExpr/eval
             Compiler.java:  457  clojure.lang.Compiler$DefExpr/eval
             Compiler.java: 7199  clojure.lang.Compiler/eval
             Compiler.java: 7653  clojure.lang.Compiler/load
                      REPL:    1  user/eval17751
                      REPL:    1  user/eval17751
             Compiler.java: 7194  clojure.lang.Compiler/eval
             Compiler.java: 7149  clojure.lang.Compiler/eval
                  core.clj: 3215  clojure.core/eval
                  core.clj: 3211  clojure.core/eval
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn/fn
                  AFn.java:  152  clojure.lang.AFn/applyToHelper
                  AFn.java:  144  clojure.lang.AFn/applyTo
                  core.clj:  667  clojure.core/apply
                  core.clj: 1990  clojure.core/with-bindings*
                  core.clj: 1990  clojure.core/with-bindings*
               RestFn.java:  425  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   87  nrepl.middleware.interruptible-eval/evaluate/fn
                  main.clj:  437  clojure.main/repl/read-eval-print/fn
                  main.clj:  437  clojure.main/repl/read-eval-print
                  main.clj:  458  clojure.main/repl/fn
                  main.clj:  458  clojure.main/repl
                  main.clj:  368  clojure.main/repl
               RestFn.java: 1523  clojure.lang.RestFn/invoke
    interruptible_eval.clj:   84  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:   56  nrepl.middleware.interruptible-eval/evaluate
    interruptible_eval.clj:  152  nrepl.middleware.interruptible-eval/interruptible-eval/fn/fn
                  AFn.java:   22  clojure.lang.AFn/run
               session.clj:  218  nrepl.middleware.session/session-exec/main-loop/fn
               session.clj:  217  nrepl.middleware.session/session-exec/main-loop
                  AFn.java:   22  clojure.lang.AFn/run
               Thread.java:  833  java.lang.Thread/run

Huahai16:09:36

I am not an expert on deps.edn, but my hunch is that you are adding jvm-opts at the wrong place. Could you try to add it under deps? Or ask in clojure channel how to do that.

đź‘Ť 1
Huahai23:09:34

For future reference, I updated the comment in github according to alex miller’s answer. https://github.com/juji-io/datalevin/issues/73#issuecomment-1242560698