Happy NYE everyone!
I was curious if anyone has seen the following error when the clojure
command is run:
Error building classpath. class java.util.HashMap$Node cannot be cast to class java.util.HashMap$TreeNode (java.util.HashMap$Node and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
I’m on clj version: 1.10.1.727
It seems to be intermittent but I’ve only seen it when clj is run with -Sdeps
and -Sforce
. I’ve seen this error thrown with both the -e
and the -m
flags used.@splayemu I wonder if you might be hitting a race condition when it is trying to figure out dependencies in parallel for some reason? You can try adding -Sthreads 1
to force it to be single-threaded.
thank you! It’s been popping up a bunch on our CI lately so I’ll give that a go and report back if it solves the problem.
Does it force the whole clojure process to only use 1 thread, or does it just change the classpath generation / clojure initialization?
Just the part that calculates/downloads dependencies. Once all the dependencies are figured out, the subsequent process that actually runs your code will run as normal.
Classpath generation
Great, thanks 🙏
I'm a bit surprised folks don't run into this issue more often. I've never seen it happen -- not locally on my Mac, nor on our build/QA server -- but I have seen a handful of people run into it repeatedly.
hmm yeah I wonder what makes it more likely to happen… I haven’t seen it locally - only on our drone env
are you using any git deps or s3 maven repo deps?
@splayemu is there more stacktrace youre omitting?
yes we have our own maven repo in s3
and we also use git deps - though not used heavily
We also use a lot of :local/root
deps (not sure if that’s useful info for you)
yep, although that doesn't help narrow it down much :) s3 repos do dynamic loading of the s3 code so that's a known issue but your stack trace looks like something else. a lot of the maven model building stuff is not thread-safe.