duct-framework / duct

Server-side application framework for Clojure
MIT License
1.13k stars 51 forks source link

#windows (cljs-repl) in nRepl, throws java.net.UnknownHostException: E #35

Closed templateK closed 8 years ago

templateK commented 8 years ago

On windows, when lein repl on project created with command lein new duct +example +cljs

lein repl 
(go)
(cljs-repl)

throws java.net.UnknownHostException: E

the 'E' is drive letter of project path

On linux this project works just fine.

stack trace

user=> (go)
Compiling "target/figwheel/myduct/public/js/main.js" from ["src" "dev"]...
notifying browser that file changed:  target/figwheel/myduct/public/js/goog/deps.js
notifying browser that file changed:  target/figwheel/myduct/public/js/cljs_deps.js
notifying browser that file changed:  out\cljs\user.js
Successfully compiled "target/figwheel/myduct/public/js/main.js" in 1.81 seconds.
:started
user=> (cljs-repl)

java.net.UnknownHostException: E
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)
        at java.net.Socket.connect(Socket.java:589)
        at java.net.Socket.connect(Socket.java:538)
        at sun.net.ftp.impl.FtpClient.doConnect(FtpClient.java:957)
        at sun.net.ftp.impl.FtpClient.tryConnect(FtpClient.java:917)
        at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:1012)
        at sun.net.ftp.impl.FtpClient.connect(FtpClient.java:998)
user=>  at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:294)
        at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:393)
        at cljs.util$last_modified.invokeStatic(util.cljc:150)
        at cljs.util$last_modified.invoke(util.cljc:142)
        at cljs.util$changed_QMARK_.invokeStatic(util.cljc:158)
        at cljs.util$changed_QMARK_.invoke(util.cljc:157)
        at cljs.analyzer$requires_analysis_QMARK_.invokeStatic(analyzer.cljc:2808)
        at cljs.analyzer$requires_analysis_QMARK_.invoke(analyzer.cljc:2786)
        at cljs.analyzer$requires_analysis_QMARK_.invokeStatic(analyzer.cljc:2793)
        at cljs.analyzer$requires_analysis_QMARK_.invoke(analyzer.cljc:2786)
        at cljs.analyzer$analyze_file.invokeStatic(analyzer.cljc:2855)
        at cljs.analyzer$analyze_file.invoke(analyzer.cljc:2828)
        at cljs.repl$analyze_source.invokeStatic(repl.cljc:728)
        at cljs.repl$analyze_source.invoke(repl.cljc:720)
        at cljs.repl$repl_STAR_$fn__10512$fn__10513$fn__10514.invoke(repl.cljc:871)
        at clojure.core$run_BANG_$fn__7276.invoke(core.clj:7393)
        at clojure.lang.PersistentVector.reduce(PersistentVector.java:341)
        at clojure.core$reduce.invokeStatic(core.clj:6544)
        at clojure.core$run_BANG_.invokeStatic(core.clj:7388)
        at clojure.core$run_BANG_.invoke(core.clj:7388)
        at cljs.repl$repl_STAR_$fn__10512$fn__10513.invoke(repl.cljc:871)
        at cljs.repl$repl_STAR_$fn__10512.invoke(repl.cljc:868)
        at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1152)
        at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1143)
        at cljs.repl$repl_STAR_.invokeStatic(repl.cljc:865)
        at cljs.repl$repl_STAR_.invoke(repl.cljc:752)
        at cemerick.piggieback$run_cljs_repl.invokeStatic(piggieback.clj:169)
        at cemerick.piggieback$run_cljs_repl.invoke(piggieback.clj:155)
        at cemerick.piggieback$cljs_repl.invokeStatic(piggieback.clj:222)
        at cemerick.piggieback$cljs_repl.doInvoke(piggieback.clj:212)
        at clojure.lang.RestFn.invoke(RestFn.java:713)
        at duct.component.figwheel$start_piggieback_repl.invokeStatic(figwheel.clj:141)
        at duct.component.figwheel$start_piggieback_repl.invoke(figwheel.clj:138)
        at duct.component.figwheel$cljs_repl.invokeStatic(figwheel.clj:151)
        at duct.component.figwheel$cljs_repl.invoke(figwheel.clj:148)
        at user$cljs_repl.invokeStatic(user.clj:44)
        at user$cljs_repl.invoke(user.clj:43)
        at user$eval25223.invokeStatic(form-init982232343948307507.clj:1)
        at user$eval25223.invoke(form-init982232343948307507.clj:1)
        at clojure.lang.Compiler.eval(Compiler.java:6927)
        at clojure.lang.Compiler.eval(Compiler.java:6890)
        at clojure.core$eval.invokeStatic(core.clj:3105)
        at clojure.core$eval.invoke(core.clj:3101)
        at clojure.main$repl$read_eval_print__7408$fn__7411.invoke(main.clj:240)
        at clojure.main$repl$read_eval_print__7408.invoke(main.clj:240)
        at clojure.main$repl$fn__7417.invoke(main.clj:258)
        at clojure.main$repl.invokeStatic(main.clj:258)
        at clojure.main$repl.doInvoke(main.clj:174)
        at clojure.lang.RestFn.invoke(RestFn.java:1523)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate$fn__4367.invoke(interruptible_eval.clj:87)
        at clojure.lang.AFn.applyToHelper(AFn.java:152)
        at clojure.lang.AFn.applyTo(AFn.java:144)
        at clojure.core$apply.invokeStatic(core.clj:646)
        at clojure.core$with_bindings_STAR_.invokeStatic(core.clj:1881)
        at clojure.core$with_bindings_STAR_.doInvoke(core.clj:1881)
        at clojure.lang.RestFn.invoke(RestFn.java:425)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invokeStatic(interruptible_eval.clj:85)
        at clojure.tools.nrepl.middleware.interruptible_eval$evaluate.invoke(interruptible_eval.clj:55)
        at clojure.tools.nrepl.middleware.interruptible_eval$interruptible_eval$fn__4412$fn__4415.invoke(interruptible_eval.clj:222)
        at clojure.tools.nrepl.middleware.interruptible_eval$run_next$fn__4407.invoke(interruptible_eval.clj:190)
        at clojure.lang.AFn.run(AFn.java:22)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
        at java.lang.Thread.run(Thread.java:745)
To quit, type: :cljs/quit

os: Windows10, runtime: JDK 8, clojure 1.8

weavejester commented 8 years ago

It looks like this is either a problem with Piggieback or Figwheel. I'll investigate as much as I can, but I don't have a development environment on Windows.

templateK commented 8 years ago

I had some digging. It turns out that the bug exists in closurescript. there's nothing can be done in this project for this bug. feel free to close.

weavejester commented 8 years ago

Thanks for investigating this.

vojkog commented 7 years ago

I think that problem is in the following line: https://github.com/clojure/clojurescript/blob/master/src/main/clojure/cljs/repl.cljc#L713

For file param e.g. "src\duct3\client.cljs" (str "file://" (.getAbsolutePath file))

evaluates on windows as: "file://C:\Projects\Playground\duct3\src\duct3\client.cljs"

which is not legal file Url (https://en.wikipedia.org/wiki/File_URI_scheme#Windows) and final result is java.net.UnknownHostException(java treat that URL as FTP address).

P.S. I have tried to post this in https://groups.google.com/forum/#!forum/clojurescript but it seems that my post is not visible (yet).

vojkog commented 7 years ago

Filed an issue as suggested in google group: https://dev.clojure.org/jira/browse/CLJS-2155

vojkog commented 5 years ago

Posted patch that solves this problem: https://dev.clojure.org/jira/secure/attachment/18574/CLJS-2155.patch