Fork me on GitHub
#cider
<
2021-07-02
>
bmaddy15:07:34

Has anyone seen errors like this when running cider-test-run-ns-tests?

Exception in thread "nREPL-session-3617ec79-0596-4ce9-b55b-c34ff8f26ba5" java.lang.IllegalArgumentException: no conversion to symbol
	at clojure.core$symbol.invokeStatic(core.clj:598)
	at clojure.core$symbol.invoke(core.clj:591)
	at cider.nrepl.middleware.test$report_fixture_error.invokeStatic(test.clj:193)
	at cider.nrepl.middleware.test$report_fixture_error.invoke(test.clj:183)
...
ERROR: Unhandled REPL handler exception processing message {:op eldoc, :ns user, :sym nrepl.middleware.session$session_exec$main_loop__1062.invoke, :session 3617ec79-0596-4ce9-b55b-c34ff8f26ba5, :id 12}
java.lang.ClassNotFoundException: com.sun.tools.javac.util.List
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at clojure.lang.DynamicClassLoader.findClass(DynamicClassLoader.java:69)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at clojure.lang.DynamicClassLoader.loadClass(DynamicClassLoader.java:77)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2212)
	at clojure.lang.RT.classForName(RT.java:2221)
	at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invokeStatic(legacy_parser.clj:88)
	at cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java.invoke(legacy_parser.clj:66)
When that happens, my repl freezes until I run sesman-restart. Here's my setup. deps.edn:
{:paths ["test"]
 :deps {org.clojure/clojure {:mvn/version "1.10.3"}}
 :aliases {:cider-clj {:extra-deps {nrepl/nrepl                   {:mvn/version "0.8.3"}
                                    refactor-nrepl/refactor-nrepl {:mvn/version "2.5.0"}
                                    cider/cider-nrepl             {:mvn/version "0.25.8"}}
                       :main-opts  ["-m" "nrepl.cmdline" "--middleware" "[\"refactor-nrepl.middleware/wrap-refactor\",\"cider.nrepl/cider-middleware\"]"]}}}
test/foo-test.clj:
(ns foo-test
  (:require [clojure.test :refer :all]))

(deftest bar
  (testing "scope"
    (let [a (/ 1 0)]
      (is (= a 0)))))

(comment
  ;; these work as expected and display a Divide by zero exception in a test output format
  (bar)
  (run-tests)

  )

bmaddy15:07:01

Also, here's my CIDER and java versions:

;; CIDER 1.1.0snapshot (package: 20210127.640), nREPL 0.8.3
;; Clojure 1.10.3, Java 1.8.0_141

bmaddy16:07:04

I should probably also mention, I'm starting it with clj -M:cider-clj and connecting with cider-connect-clj

blak3mill3r08:07:20

Check for exceptions in your fixture(s)

bmaddy20:07:06

Thanks for the response. I did see that one, but I'm not using any fixtures. It does seem very similar. The code I posted is all that's needed to cause it. Perhaps let bindings are treated as fixtures somehow? 🤷

blak3mill3r20:07:05

What version of Java are you using?

blak3mill3r20:07:15

com.sun.tools.javac.util.List
I think changed in some way between 8 and 9

blak3mill3r20:07:06

your deps.edn does not peg a version of orchard

blak3mill3r20:07:13

I wonder where your orchard dependency is coming from

blak3mill3r20:07:33

are you using the "jack-in" approach (even though you have the cider-nrepl stuff declared explicitly)?

blak3mill3r20:07:16

the stack trace shows that cider.nrepl.inlined_deps.orchard.v0v6v4.orchard.java.legacy_parser$parse_java is trying to use this class that changed between java versions

blak3mill3r20:07:26

so perhaps you are using a new orchard with an old JVM

bmaddy03:07:54

Upgrading java completely fixed it! I have no idea what version of orchard is being used. I tried looking at the dependency graph with tools.deps.graph, but orchard didn't show up. 🤷 Still, it all works with java 11. Thanks so much for your help @UC681SR17!! 😄

👌 2