Fork me on GitHub
#datalevin
<
2022-06-19
>
Benjamin08:06:21

Execution error (InaccessibleObjectException) at java.lang.reflect.AccessibleObject/checkCanSetAccessible (AccessibleObject.java:354).
Unable to make field long java.nio.Buffer.address accessible: module java.base does not "opens java.nio" to unnamed module @69a12179
did you ever see this? when calling d/get-conn from a blank project 1 sec I post code

Benjamin08:06:34

(ns org.sg.gmsarena-scraper.check)

(require '[datalevin.core :as d])

(defn main [& _]

  ;; Define an optional schema.
  ;; Note that pre-defined schema is optional, as Datalevin does schema-on-write.
  ;; However, attributes requiring special handling need to be defined in schema,
  ;; e.g. many cardinality, uniqueness constraint, reference type, and so on.
  (def schema {:aka  {:db/cardinality :db.cardinality/many}
               ;; :db/valueType is optional, if unspecified, the attribute will be
               ;; treated as EDN blobs, and may not be optimal for range queries
               :name {:db/valueType :db.type/string
                      :db/unique    :db.unique/identity}})

  ;; Create DB on disk and connect to it, assume write permission to create given dir
  (def conn (d/get-conn "/tmp/datalevin/mydb" schema)))
deps.edn:
{:paths ["src"]
 :deps {enlive/enlive {:mvn/version "1.1.6"}
        datalevin/datalevin {:mvn/version "0.6.14"}
        com.cognitect/transit-clj {:mvn/version "1.0.329"}}}

Benjamin08:06:30

[benj@benj-pc gmsarena-scraper] 1 $ java --version

openjdk 18.0.1.1 2022-04-22
OpenJDK Runtime Environment (build 18.0.1.1+2)
OpenJDK 64-Bit Server VM (build 18.0.1.1+2, mixed mode)

Huahai18:06:24

--add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED

Huahai18:06:34

You need these.

Benjamin18:06:39

oh I'm sorry I didn't see this in the readme.