Skip to content

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

@holyjak

Description

@holyjak

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=>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions