This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-05-07
Channels
- # asami (1)
- # aws (2)
- # babashka (5)
- # babashka-sci-dev (162)
- # beginners (68)
- # biff (1)
- # calva (26)
- # circleci (4)
- # clj-kondo (5)
- # cljs-dev (7)
- # clojure (84)
- # clojure-europe (15)
- # clojure-uk (1)
- # clojured (2)
- # clojurescript (19)
- # conjure (1)
- # datomic (5)
- # emacs (2)
- # graalvm (20)
- # honeysql (6)
- # improve-getting-started (2)
- # kaocha (3)
- # lsp (31)
- # off-topic (7)
- # pathom (7)
- # releases (1)
- # shadow-cljs (1)
- # spacemacs (1)
- # vim (30)
what is your general approach to making some java lib compile / run? issue in thread
runtime error when I call some static constructor thingy:
Exception in thread "main" java.lang.ExceptionInInitializerError
at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:87)
at com.google.api.client.googleapis.javanet.GoogleNetHttpTransport.newTrustedTransport(GoogleNetHttpTransport.java:58)
at google_api_clj.google_client$create_google_client.invokeStatic(google_client.clj:29)
...
Caused by: java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:645)
at com.google.api.client.googleapis.GoogleUtils.<clinit>(GoogleUtils.java:66)
... 9 more
https://cloud.google.com/java/docs/reference/google-api-client/latest/com.google.api.client.googleapis.javanet.GoogleNetHttpTransport
I'm not sure but I think it is because it caches something when it initializesI import the namespace package and call a static method in a function in a clojure namespace
"--initialize-at-build-time=com.google.api.client.util.DateTime"
"--initialize-at-build-time=com.google.common.base.Preconditions"
"--initialize-at-build-time=com.google.api.client.util.Data"
"--initialize-at-build-time=com.google.common.base.Preconditions"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.Spreadsheet"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.RowData"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.Sheet"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.DimensionProperties"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.FilterView"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.GridData"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.ProtectedRange"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.DimensionProperties"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.FilterView"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.ProtectedRange"
"--initialize-at-build-time=com.google.api.services.sheets.v4.model.GridData"
I just naively put all classes that graalvm threw as warningyes. but it might be coming from your https://github.com/viebel/google-api-clj library you mentioned earlier.
I got rid of all the build time initializing, unfortunately I still have this issue:
Caused by: java.lang.IllegalStateException: No match found
at java.util.regex.Matcher.group(Matcher.java:645)
at com.google.api.client.googleapis.GoogleUtils.<clinit>(GoogleUtils.java:66)
... 9 more
now I'm on another lead. I decompiled this GoogleUtils class with intellij and see there is some hardcoded regex pattern making assumption about the version string. This is promising because I just set the version to the git sha
it is using some .properties "resource". I saw there is a way to define resources for graalvm right?
ok I'm doing it https://www.graalvm.org/22.1/reference-manual/native-image/Resources/