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

Fails with "java.net.Socket cannot be cast to class java.lang.String" #40

Open
holyjak opened this issue Dec 11, 2019 · 1 comment
Open

Fails with "java.net.Socket cannot be cast to class java.lang.String" #40

holyjak opened this issue Dec 11, 2019 · 1 comment

Comments

@holyjak
Copy link

@holyjak holyjak commented Dec 11, 2019

I want to connect to a remote nREPL server but the invocation fails:

deps.edn:

{:aliases {:repl {:extra-deps {nrepl/nrepl {:mvn/version "0.6.0"} 
                                              nrepl/drawbridge {:mvn/version "0.2.1"}}
           :main-opts  ["-m" "nrepl.cmdline" "--connect" "--transport" 
                               "drawbridge.client/ring-client-transport" 
                               "--port" "55555" "--host"]}}}

command:

clojure -Arepl 10.199.227.33

output:

Execution error (ClassCastException) at clj-http.client/parse-url (client.clj:175).
class java.net.Socket cannot be cast to class java.lang.String (java.net.Socket and java.lang.String are in module java.base of loader 'bootstrap')

See the full output from clojure in this gist: https://gist.github.com/holyjak/7a644ef57bc17807ac18d22d820bbda7

Environment

  • Amazon Linux 2 or OSX
  • JVM java-11-amazon-corretto.x86_64 or java-1.8.0-openjdk

It is quite likely I do something wrong but I have no idea what :(

It works with lein

Using leiningen 2.9 and project.clj:

(defproject repl-client-drawbridge "0.1.0-SNAPSHOT"
  :plugins [[nrepl/drawbridge "0.2.1"]])

this works:

$ lein repl :connect http://10.199.227.33:55555
Connecting to nREPL at http://10.199.227.33:55555
REPL-y 0.4.3, nREPL 0.6.0
Clojure 1.10.1
OpenJDK 64-Bit Server VM 11.0.1+13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=>
@holyjak holyjak changed the title Fails with "java.net.Socket cannot be cast to class java.lang.String" under java 11 Fails with "java.net.Socket cannot be cast to class java.lang.String" Dec 11, 2019
@bbatsov

This comment has been minimized.

Copy link
Contributor

@bbatsov bbatsov commented Dec 12, 2019

Looking at the stacktrace, it seems to me some conversion is missing. Probably Lein does it somewhere, but we don't do it in the built-in CLI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.