Hello everyone! Recently I’ve been trying to compile a clojure project with graalvm, and I’ve been facing class initialization errors both on runtime and buildtime. I was wondering if anyone could help 😅
Here’s my project.clj
file
running the binary image shows a java.lang.ExceptionInInitializerError
I got this
Original exception that caused the problem: org.graalvm.compiler.code.SourceStackTraceBailoutException$1: unbalanced monitors: mismatch at monitorexit, 3|LoadField#lockee__5436__auto__ != 96|LoadField#lockee__5436__auto__
when trying to compile the binary using verbose and printing error stacks@m.amarnah Can you try again with clojure 1.10.2-alpha1?
I just tried with clojure 1.10.0 and it gave the same thing
1.10.2-alpha1 specifically
sure thing
the core team has made a fix for the mismatch monitorexit problem in that release
oh okay, is that a problem that has to do with initializing/using thread pools?
it has to do with the locking macro. if thread pools use that locking macro, then indirectly, potentially related
cool, cool
So I think that fixed the mismatch monitorexit problem. It was showing Error: Unsupported features in 3 methods
and now it says 2 methods instead of 3.
The thing is down the stack trace I found this Caused by: <http://java.io|java.io>.FileNotFoundException: project.clj (No such file or directory)
Here’s the stack trace
Just a side note, I’m importing native java libraries in my clojure code.
(:import [java.util.concurrent Executors ExecutorService TimeUnit])
although I tried importing that in a hello world project and it worked just fine.
@m.amarnah why does your code try to load a project.clj file?
do you have a link to the code itself?