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

Cannot connect to REPL without tools.jar explicitly on the classpath (java.lang.ClassNotFoundException: com.sun.javadoc.ClassDoc) #505

Closed
jarohen opened this issue Feb 12, 2018 · 2 comments

Comments

@jarohen
Copy link

jarohen commented Feb 12, 2018

Expected behavior

Able to connect to REPL

Actual behavior

cider-connect times out, NPE raised:

2018-02-12 10:30:44,969 [clojure-agent-send-off-pool-3] ERROR clojure.tools.nrepl.server - Unhandled REPL handler exception processing message {:op describe, :session 73a6492b-c5ce-42e0-9b8e-6905c68f2d9c, :id 10}
java.lang.NullPointerException: null
core.clj:2292 clojure.core/deref-future
core.clj:2312 clojure.core/deref
core.clj:2298 clojure.core/deref
nrepl.clj:90 cider.nrepl/wrap-pprint-fn[fn]
middleware.clj:22 clojure.tools.nrepl.middleware/wrap-conj-descriptor[fn]
session.clj:192 clojure.tools.nrepl.middleware.session/session[fn]
middleware.clj:22 clojure.tools.nrepl.middleware/wrap-conj-descriptor[fn]
nrepl.clj:354 cider.nrepl/wrap-spec[fn]
middleware.clj:22 clojure.tools.nrepl.middleware/wrap-conj-descriptor[fn]
middleware.clj:159 refactor-nrepl.middleware/wrap-refactor[fn]
middleware.clj:22 clojure.tools.nrepl.middleware/wrap-conj-descriptor[fn]
server.clj:19 clojure.tools.nrepl.server/handle*
server.clj:16 clojure.tools.nrepl.server/handle*
server.clj:28 clojure.tools.nrepl.server/handle[fn]
core.clj:2022 clojure.core/binding-conveyor-fn[fn]
AFn.java:18 clojure.lang.AFn.call
FutureTask.java:266 java.util.concurrent.FutureTask.run
ThreadPoolExecutor.java:1149 java.util.concurrent.ThreadPoolExecutor.runWorker
ThreadPoolExecutor.java:624 java.util.concurrent.ThreadPoolExecutor$Worker.run
Thread.java:748 java.lang.Thread.run

Steps to reproduce the problem

Running my application with java -cp my-uberjar.jar clojure.main, then using the following to start an embedded REPL:

(clojure.tools.nrepl.server/start-server :bind "localhost"
                                         :port 7888
                                         :handler (-> cider.nrepl/cider-nrepl-handler
                                                      refactor-nrepl.middleware/wrap-refactor))

Digging into it further, requiring cider.nrepl.middleware.util.java.parser seems sufficient to reproduce the issue - fails with java.lang.ClassNotFoundException: com.sun.javadoc.ClassDoc. Workaround is to ensure that $JAVA_HOME/lib/tools.jar is present on the classpath.

Environment & Version information

cider-nrepl version

0.16.0

Java version

1.8.0_161, x64

Operating system

Ubuntu

@jarohen
Copy link
Author

jarohen commented Feb 12, 2018

Ah, I suspect this is a dupe of #447, although seems like the ClassNotFoundError might be something different. Feel free to close :)

@jarohen
Copy link
Author

jarohen commented Feb 21, 2018

closing as a dupe

@jarohen jarohen closed this as completed Feb 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant