Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ExceptionInInitializerError in Clojure 1.9 #91

Closed
liquidz opened this issue May 30, 2020 · 17 comments
Closed

ExceptionInInitializerError in Clojure 1.9 #91

liquidz opened this issue May 30, 2020 · 17 comments
Labels
bug Something isn't working

Comments

@liquidz
Copy link
Member

liquidz commented May 30, 2020

Expected behavior

REPL starts with Orchard 0.5.9 and Clojure 1.9.0 normally.

Actual behavior

Exception in thread "main" java.lang.ExceptionInInitializerError
        at clojure.main.<clinit>(main.java:20)
Caused by: java.lang.RuntimeException: Unable to find static field: REQUIRE_LOCK in class clojure.lang.RT, compiling:(clojure/core.clj:6079:3)
        at clojure.lang.Compiler.analyze(Compiler.java:6792)
        at clojure.lang.Compiler.access$300(Compiler.java:38)
        at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6368)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6991)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6991)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.analyze(Compiler.java:6729)
        at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100)
        at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460)
        at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:6991)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.access$300(Compiler.java:38)
        at clojure.lang.Compiler$DefExpr$Parser.parse(Compiler.java:595)
        at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003)
        at clojure.lang.Compiler.analyze(Compiler.java:6773)
        at clojure.lang.Compiler.analyze(Compiler.java:6729)
        at clojure.lang.Compiler.eval(Compiler.java:7066)
        at clojure.lang.Compiler.load(Compiler.java:7514)
        at clojure.lang.RT.loadResourceScript(RT.java:379)
        at clojure.lang.RT.loadResourceScript(RT.java:370)
        at clojure.lang.RT.load(RT.java:460)
        at clojure.lang.RT.load(RT.java:426)
        at clojure.lang.RT.doInit(RT.java:468)
        at clojure.lang.RT.<clinit>(RT.java:336)
        ... 1 more
Caused by: java.lang.RuntimeException: Unable to find static field: REQUIRE_LOCK in class clojure.lang.RT
        at clojure.lang.Util.runtimeException(Util.java:221)
        at clojure.lang.Compiler.analyzeSymbol(Compiler.java:7196)
        at clojure.lang.Compiler.analyze(Compiler.java:6752)
        ... 30 more
Subprocess failed (exit code: 1)

Steps to reproduce the problem

  • lein new foo
  • cd foo
  • Edit project.clj like below
(defproject foo "0.1.0-SNAPSHOT"
  :description "FIXME: write description"
  :url "http://example.com/FIXME"
  :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
            :url "https://www.eclipse.org/legal/epl-2.0/"}
  :dependencies [[org.clojure/clojure "1.9.0"]
                 [cider/orchard "0.5.9"]]
  :repl-options {:init-ns foo.core})
  • lein repl

Environment & Version information

Clojure version

1.9.0

Java version

1.8

Operating system

macOS Catalina

@liquidz
Copy link
Member Author

liquidz commented May 30, 2020

I've found the behavior difference like following.

git clone https://github.com/clojure-emacs/orchard
cd orchard

rm -rf ~/.m2/repository/cider/orchard/0.5.9 && lein with-profile +1.10 install
## => No problem

rm -rf ~/.m2/repository/cider/orchard/0.5.9 && lein install
## => ERROR

So it may be mistaken in createing deployed JAR file.

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

Hmm, that's pretty weird. I cut the release just as I always did (just a lein deploy).

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

It seems something's wrong with the CI and it hasn't been triggering for a few days - https://circleci.com/gh/clojure-emacs/orchard/tree/master

I get a bunch of local failures as well, and I assume they are related to #89 by @arichiardi, as it this was the only notable change recently.

@liquidz
Copy link
Member Author

liquidz commented May 31, 2020

Oh, I was misunderstanding that you were using make release.

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

I had forgotten it even exists. I do use make deploy, but it's more or less the same as make deploy clojars.

Btw, are you getting lots of failing tests when doing make test locally?

@liquidz
Copy link
Member Author

liquidz commented May 31, 2020

Btw, are you getting lots of failing tests when doing make test locally?

No errors in orchard itself.

Ran 112 tests containing 506 assertions.
0 failures, 0 errors.

On the other hand, I'm getting failures iniced-nrepl test.
https://github.com/liquidz/iced-nrepl/runs/723767673?check_suite_focus=true

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

Weird. I keep getting 11 errors (mostly to do with Java class/members info) with and without #89.

@bbatsov
Copy link
Member

bbatsov commented May 31, 2020

Anyways, I can reproduce your problem but I still have no idea what causes it. I tried reverting #89, but I still get this error and there no other material commits in this release (or at least none of them seems related to me). I'll keep digging.

@arichiardi
Copy link
Contributor

Oh strange, I will also try to see what's going on. It definitely seems unrelated as a first glance... Will also report back.

@liquidz
Copy link
Member Author

liquidz commented May 31, 2020

In clojars, 0.5.9 depends on clojure 1.10.1 while other versions not.

Could it be relevant?

@bbatsov
Copy link
Member

bbatsov commented Jun 1, 2020

Yeah, this seems like something that could be relevant, but the dependencies of the project haven't been changed in 0.5.8. Clojure is supposed to be a provided dependency, not an explicit dependency. I'm wondering if that's not some bug in Lein 2.9.3, as I think I've recently upgraded to it.

@bbatsov
Copy link
Member

bbatsov commented Jun 2, 2020

I'm now pretty sure that @liquidz is right and the extra dep is breaking things, but I still can't think of anything that might be causing this other than might suggestion about a Lein bug. Any help/ideas would be welcome!

@bbatsov
Copy link
Member

bbatsov commented Jun 2, 2020

@clojure-emacs/cider Can someone with an older Lein try a make install and check the generated pom.xml in the jar?

@bbatsov bbatsov added the bug Something isn't working label Jun 3, 2020
@bbatsov
Copy link
Member

bbatsov commented Jun 3, 2020

I can confirm that downgrading to Lein 2.9.1 fixed this. I've issued 0.5.10 that works just fine, but I guess I'll also have to report this issue upstream. I have no idea which change in Lein caused it.

@liquidz
Copy link
Member Author

liquidz commented Jun 3, 2020

Thanks!
I also confirmed iced-nrepl's test passes with 0.5.10.
https://github.com/liquidz/iced-nrepl/runs/736200238?check_suite_focus=true

@bbatsov
Copy link
Member

bbatsov commented Jun 7, 2020

I've reported the issue upstream to Leiningen. Hopefully someone will be able to track down the exact problem.

@bbatsov
Copy link
Member

bbatsov commented Jul 9, 2020

The Leiningen issue (technomancy/leiningen#2687) was just fixed in technomancy/leiningen@8fb39db Long story short - composite profiles are incompatible with provided and now that's explicit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants