Clojure

clojure.java.browse/browse-url fails to open http://localhost:3000 with swing backend

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Declined
  • Affects Version/s: Release 1.3
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

I've got the following exception after launching (clojure.java.browse/browse-url "http://localhost:3000"):

java.lang.RuntimeException: java.io.FileNotFoundException: http://localhost:3000
at clojure.lang.Util.runtimeException(Util.java:165)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:193)
at clojure.java.browse_ui$open_url_in_swing.invoke(browse_ui.clj:15)
at clojure.lang.Var.invoke(Var.java:401)
at clojure.java.browse$open_url_in_swing.invoke(browse.clj:44)
at clojure.java.browse$browse_url.invoke(browse.clj:52)
at user$eval1689.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at swank.commands.basic$eval_region.invoke(basic.clj:47)
at swank.commands.basic$eval_region.invoke(basic.clj:37)
at swank.commands.basic$eval845$listener_eval__846.invoke(basic.clj:71)
at clojure.lang.Var.invoke(Var.java:401)
at user$eval1687.invoke(NO_SOURCE_FILE)
at clojure.lang.Compiler.eval(Compiler.java:6465)
at clojure.lang.Compiler.eval(Compiler.java:6431)
at clojure.core$eval.invoke(core.clj:2795)
at swank.core$eval_in_emacs_package.invoke(core.clj:92)
at swank.core$eval_for_emacs.invoke(core.clj:239)
at clojure.lang.Var.invoke(Var.java:409)
at clojure.lang.AFn.applyToHelper(AFn.java:167)
at clojure.lang.Var.applyTo(Var.java:518)
at clojure.core$apply.invoke(core.clj:600)
at swank.core$eval_from_control.invoke(core.clj:99)
at swank.core$eval_loop.invoke(core.clj:104)
at swank.core$spawn_repl_thread$fn_527$fn_528.invoke(core.clj:309)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:600)
at swank.core$spawn_repl_thread$fn__527.doInvoke(core.clj:306)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at clojure.lang.AFn.run(AFn.java:24)
at java.lang.Thread.run(Thread.java:679)
Caused by: java.io.FileNotFoundException: http://localhost:3000
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1458)
at java.security.AccessController.doPrivileged(Native Method)
at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1452)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1106)
at javax.swing.JEditorPane.getStream(JEditorPane.java:827)
at javax.swing.JEditorPane.setPage(JEditorPane.java:433)
at javax.swing.JEditorPane.setPage(JEditorPane.java:939)
at javax.swing.JEditorPane.<init>(JEditorPane.java:273)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at clojure.lang.Reflector.invokeConstructor(Reflector.java:183)
... 32 more
Caused by: java.io.FileNotFoundException: http://localhost:3000
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1401)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:397)
at javax.swing.JEditorPane.getStream(JEditorPane.java:792)
... 40 more

It works with urls like http://google.com:80, so probably the problem is in the combination of one-segment domen and port.

Note: I use Ubuntu 11.10 with Chromium as a default browser. I'm not sure why browse-url fails to open urls via standart browser. Should I create another issue for that or is it a java problem?

Activity

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: