ClojureScript One in Eclipse

521 views
Skip to first unread message

turcio

unread,
Feb 17, 2012, 7:14:33 AM2/17/12
to Clojure
Hi,
I'm trying to run ClojureScript One using CCW plugin in Eclipse. I
created a new project and imported all the source code into it. Then I
added folders to the build path that reflect the following
configuration from project.clj:

:git-dependencies [["https://github.com/clojure/clojurescript.git"
"886d8dc81812962d30a741d6d05ce9d90975160f"]
["https://github.com/levand/domina.git"
"8933b2d12c44832c9bfaecf457a1bc5db251a774"]]
:extra-classpath-dirs [".lein-git-deps/clojurescript/src/clj"
".lein-git-deps/clojurescript/src/cljs"
".lein-git-deps/domina/src/cljs"
"src/app/cljs"
"src/app/cljs-macros"
"src/lib/clj"
"src/lib/cljs"
"templates"]

I also executed "lein bootstrap" and added libraries to the build path
in Eclipse.

Now I'm running the app by right clicking on project folder, then Run
as->Clojure application. In repl I execute: (in-ns 'one.sample.repl)
(dev-server)). The browser shows up the homepage, but when I click on
Development tab the exception listed below occurs. Some files
ClojureScript fiiles are generated but not all. Also empty "out"
directory is created in the root folder.

Any ideas?

Thanks,
Daniel

************************************************************************************************************************

2012-02-17 12:06:17.393:WARN::/development
java.lang.AssertionError: Assert failed: Can't recur here|frame
at cljs.compiler$fn__877.invoke(compiler.clj:762)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1033)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$fn__801.invoke(compiler.clj:606)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1033)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$parse_invoke$fn__1014.invoke(compiler.clj:979)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.PersistentVector.create(PersistentVector.java:50)
at
clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:
31)
at clojure.core$vec.invoke(core.clj:345)
at cljs.compiler$parse_invoke.invoke(compiler.clj:979)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1034)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$fn__801.invoke(compiler.clj:607)
at clojure.lang.MultiFn.invoke(MultiFn.java:177)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1033)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$parse_invoke$fn__1014.invoke(compiler.clj:979)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.RT.seq(RT.java:466)
at
clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:
31)
at clojure.core$vec.invoke(core.clj:345)
at cljs.compiler$parse_invoke.invoke(compiler.clj:979)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1034)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$parse_invoke$fn__1014.invoke(compiler.clj:979)
at clojure.core$map$fn__3811.invoke(core.clj:2432)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
at clojure.lang.LazySeq.seq(LazySeq.java:60)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.PersistentVector.create(PersistentVector.java:50)
at
clojure.lang.LazilyPersistentVector.create(LazilyPersistentVector.java:
31)
at clojure.core$vec.invoke(core.clj:345)
at cljs.compiler$parse_invoke.invoke(compiler.clj:979)
at cljs.compiler$analyze_seq.invoke(compiler.clj:1034)
at cljs.compiler$analyze.invoke(compiler.clj:1086)
at cljs.compiler$analyze.invoke(compiler.clj:1079)
at cljs.compiler$analyze_file.invoke(compiler.clj:1105)
at cljs.compiler$compile_file_STAR_.invoke(compiler.clj:1136)
at cljs.compiler$compile_file.invoke(compiler.clj:1184)
at cljs.compiler$compile_root.invoke(compiler.clj:1244)
at cljs.closure$compile_dir.invoke(closure.clj:304)
at cljs.closure$fn__1377.invoke(closure.clj:336)
at cljs.closure$fn__1322$G__1317__1329.invoke(closure.clj:215)
at cljs.closure$fn__1370.invoke(closure.clj:350)
at cljs.closure$fn__1322$G__1317__1329.invoke(closure.clj:215)
at cljs.closure$build.invoke(closure.clj:785)
at one.reload$watch_cljs$fn__340.invoke(reload.clj:53)
at ring.middleware.file$wrap_file$fn__464.invoke(file.clj:29)
at one.sample.dev_server$rewrite_design_uris
$fn__454.invoke(dev_server.clj:53)
at ring.middleware.file_info$wrap_file_info
$fn__483.invoke(file_info.clj:40)
at one.templates$apply_templates$fn__318.invoke(templates.clj:77)
at one.sample.dev_server$js_encoding$fn__448.invoke(dev_server.clj:
41)
at ring.middleware.params$wrap_params$fn__504.invoke(params.clj:76)
at one.sample.dev_server$set_active_menu
$fn__461.invoke(dev_server.clj:75)
at ring.middleware.stacktrace$wrap_stacktrace_log
$fn__1156.invoke(stacktrace.clj:15)
at ring.middleware.stacktrace$wrap_stacktrace_web
$fn__1188.invoke(stacktrace.clj:79)
at one.reload$reload_clj$fn__353.invoke(reload.clj:76)
at clojure.lang.Var.invoke(Var.java:401)
at ring.adapter.jetty$proxy_handler$fn__411.invoke(jetty.clj:16)
at ring.adapter.jetty.proxy$org.mortbay.jetty.handler.AbstractHandler
$0.handle(Unknown Source)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:926)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector
$Connection.run(SocketConnector.java:228)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)

turcio

unread,
Feb 19, 2012, 5:28:50 PM2/19/12
to Clojure
Actually, has anybody succeeded to run ClojureScript One from Eclipse?

Daniel

Nick Klauer

unread,
Feb 19, 2012, 11:30:00 PM2/19/12
to clo...@googlegroups.com
I'm not sure it's entirely possible, but I could be wrong.  When I asked a few months ago about Leiningen integration with Eclipse, it wasn't officially supported yet, and I would have to use some sort of nREPL connection.


So it's possible, but I just haven't dug into doing it much since then.

Chas Emerick

unread,
Feb 20, 2012, 6:05:59 AM2/20/12
to clo...@googlegroups.com
Yes, I just cloned and started ClojureScript One using ccw. I was able to get the dev server up and running, and click around in all the tabs without any exceptions.

You didn't say whether you did this or not, but in addition to the directories specified in :extra-classpath-dirs, you need to add the :source-path, as well as all of the jars in lib/.

Note that the browser-connected REPL (at least, when run via one.sample.repl/go) hoists itself up on top of the REPL you start via Run > Clojure Application, and assumes that it's in a console, and therefore doesn't play well with the ccw REPL, assumes the opposite. Specifically, the browser-connected REPL uses stdin, one of the few places where "regular" REPLs outpace REPL servers like nREPL (which ccw uses) and swank. For this reason, you can't use the browser-connected REPL from within SLIME either AFAIK.

That shouldn't stop you from being able to use ccw for editing ClojureScript files, managing the server side of things in a ccw REPL, etc. You'd just need to use lein for the browser-connected REPL.

Quality support for ClojureScript in ccw would probably require:

1. Finishing the leiningen integration (underway now, though we're targeting Leiningen 2 to start, and perhaps backfilling Leiningen 1.x support depending on various factors).
2. One of: adding an "inferior-clojure" mode so that the browser-connected REPL will work sanely; or, figuring out how to support the browser-connected REPL within the scope of nREPL; or, something else I've not thought of in the last 5 minutes. :-)

Cheers,

- Chas

> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to clo...@googlegroups.com
> Note that posts from new members are moderated - please be patient with your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

turcio

unread,
Feb 20, 2012, 4:05:08 PM2/20/12
to Clojure
On Feb 20, 11:05 am, Chas Emerick <c...@cemerick.com> wrote:
> Yes, I just cloned and started ClojureScript One using ccw.  I was able to get the dev server up and running, and click around in all the tabs without any exceptions.
>
> You didn't say whether you did this or not, but in addition to the directories specified in :extra-classpath-dirs, you need to add the :source-path, as well as all of the jars in lib/.

All the following were added to the buildpath of newly created CCW
Clojure project:
lib/*.jar
lib/dev/*.jar
:source-path entry from project.clj
:extra-classpath-dirs entries from project.clj
classpath folder (generated by CCW)

Then on freshly cloned, lein bootstrapped, eclipsed project I do: Run
as->Clojure application. At this point all the namespaces are loaded
(sometimes they are not, so I need to do some magic cleaning/closing
opening of project/removing "run configuration").

No luck with all of this -> (one.sample.repl/dev-server) opens website
but 'development' and 'production' tab produce previously mentioned
exception and error web page. If I enter http://localhost:8080/development
once again I'm getting nice empty page with no exception, and no
application either.

I even tried it on freshly dowloaded Eclipse and CCW. Clojure builder
is turned on (just read your comments on CCW list about the autobuild
feature).

Chas, have you been able to run ClojureScript One in exactly the same
manner?

Daniel

turcio

unread,
Feb 20, 2012, 6:53:19 PM2/20/12
to Clojure
I created a run configuration where I added /src/one/sample/repl.clj
to 'Evaluate Clojure source file(s)' list. The namespaces are loaded
every time now. The development and production tabs produce exception
at first attempt. On the second attempt everything works as expected
except the JavaScript error occurs - probably ClojureScript repl
issue.

I still need to spend more time and polish my configuration though.

Cheers,
Daniel

On Feb 20, 9:05 pm, turcio <tur...@gmail.com> wrote:
> On Feb 20, 11:05 am, Chas Emerick <c...@cemerick.com> wrote:
>
> > Yes, I just cloned and started ClojureScript One using ccw.  I was able to get the dev server up and running, and click around in all the tabs without any exceptions.
>
> > You didn't say whether you did this or not, but in addition to the directories specified in :extra-classpath-dirs, you need to add the :source-path, as well as all of the jars in lib/.
>
> All the following were added to the buildpath of newly created CCW
> Clojure project:
> lib/*.jar
> lib/dev/*.jar
> :source-path entry from project.clj
> :extra-classpath-dirs entries from project.clj
> classpath folder (generated by CCW)
>
> Then on freshly cloned, lein bootstrapped, eclipsed project I do: Run
> as->Clojure application. At this point all the namespaces are loaded
> (sometimes they are not, so I need to do some magic cleaning/closing
> opening of project/removing "run configuration").
>
> No luck with all of this -> (one.sample.repl/dev-server) opens website
> but 'development' and 'production' tab produce previously mentioned
> exception and error web page. If I enterhttp://localhost:8080/development

Chas Emerick

unread,
Feb 21, 2012, 5:42:43 AM2/21/12
to clo...@googlegroups.com

On Feb 20, 2012, at 4:05 PM, turcio wrote:

> Chas, have you been able to run ClojureScript One in exactly the same
> manner?

I did, yes, though I (foolishly) blew away the project right after. If you continue to have issues, I might be persuaded to reconfigure it and post the resulting .project file somewhere.

- Chas

Chas Emerick

unread,
Feb 21, 2012, 5:45:22 AM2/21/12
to clo...@googlegroups.com
FWIW, nREPL is on its way to being baked into Leiningen, so the REPL-protocol-interop issue you had will be effectively eliminated.

Laurent is hard at work on the actual Leiningen project integration and support; it's coming, it's coming. :-)

- Chas

Laurent PETIT

unread,
Feb 21, 2012, 5:55:02 AM2/21/12
to clo...@googlegroups.com


2012/2/21 Chas Emerick <ch...@cemerick.com>

FWIW, nREPL is on its way to being baked into Leiningen, so the REPL-protocol-interop issue you had will be effectively eliminated.

Laurent is hard at work on the actual Leiningen project integration and support; it's coming, it's coming. :-)

I confirm :)
 

nchurch

unread,
Apr 4, 2012, 1:02:49 PM4/4/12
to Clojure
> Note that the browser-connected REPL (at least, when run via one.sample.repl/go) hoists itself up on top of the REPL you start via Run > Clojure >Application, and assumes that it's in a console, and therefore doesn't play well with the ccw REPL, assumes the opposite.

I assume this means the browser repl from cljs-template would not work
from ccw either? (I tried it, and I get a continuous stream of EOF
errors scrolling by.)

Turcio, did you figure anything else out about your configuration of
One in ccw?

Thanks,

Nick.

On Feb 20, 7:05 am, Chas Emerick <c...@cemerick.com> wrote:
> Yes, I just cloned and started ClojureScript One usingccw.  I was able to get the dev server up and running, and click around in all the tabs without any exceptions.
>
> You didn't say whether you did this or not, but in addition to the directories specified in :extra-classpath-dirs, you need to add the :source-path, as well as all of the jars in lib/.
>
> Note that thebrowser-connectedREPL(at least, when run via one.sample.repl/go) hoists itself up on top of theREPLyou start via Run > Clojure Application, and assumes that it's in a console, and therefore doesn't play well with theccwREPL, assumes the opposite.  Specifically, thebrowser-connectedREPLuses stdin, one of the few places where "regular" REPLs outpaceREPLservers like nREPL (whichccwuses) and swank.  For this reason, you can't use thebrowser-connectedREPLfrom within SLIME either AFAIK.
>
> That shouldn't stop you from being able to useccwfor editing ClojureScript files, managing the server side of things in accwREPL, etc.  You'd just need to use lein for thebrowser-connectedREPL.
>
> Quality support for ClojureScript inccwwould probably require:
>
> 1. Finishing the leiningen integration (underway now, though we're targeting Leiningen 2 to start, and perhaps backfilling Leiningen 1.x support depending on various factors).
> 2. One of: adding an "inferior-clojure" mode so that thebrowser-connectedREPLwill work sanely; or, figuring out how to support thebrowser-connectedREPLwithin the scope of nREPL; or, something else I've not thought of in the last 5 minutes. :-)
>
> Cheers,
>
> - Chas
>
> On Feb 19, 2012, at 5:28 PM, turcio wrote:
>
>
>
>
>
>
>
> > Actually, has anybody succeeded to run ClojureScript One from Eclipse?
>
> > Daniel
>
> > On Feb 17, 12:14 pm, turcio <tur...@gmail.com> wrote:
> >> Hi,
> >> I'm trying to run ClojureScript One usingCCWplugin in Eclipse. I
> >> created a new project and imported all the source code into it. Then I
> >> added folders to the build path that reflect the following
> >> configuration from project.clj:
>
> >> :git-dependencies [["https://github.com/clojure/clojurescript.git"
> >> "886d8dc81812962d30a741d6d05ce9d90975160f"]
> >>                      ["https://github.com/levand/domina.git"
> >> "8933b2d12c44832c9bfaecf457a1bc5db251a774"]]
> >>   :extra-classpath-dirs [".lein-git-deps/clojurescript/src/clj"
> >>                          ".lein-git-deps/clojurescript/src/cljs"
> >>                          ".lein-git-deps/domina/src/cljs"
> >>                          "src/app/cljs"
> >>                          "src/app/cljs-macros"
> >>                          "src/lib/clj"
> >>                          "src/lib/cljs"
> >>                          "templates"]
>
> >> I also executed "lein bootstrap" and added libraries to the build path
> >> in Eclipse.
>
> >> Now I'm running the app by right clicking on project folder, then Run
> >> as->Clojure application. InreplI execute: (in-ns 'one.sample.repl)
> >> (dev-server)). Thebrowsershows up the homepage, but when I click on

Daniel Turczański

unread,
Apr 5, 2012, 2:24:38 PM4/5/12
to clo...@googlegroups.com
>I assume this means the browser repl from cljs-template would not work 
>from ccw either? (I tried it, and I get a continuous stream of EOF 
>errors scrolling by.) 

Yeah, it's just not compatible. Stream of EOFs is what you'll get.


>Turcio, did you figure anything else out about your configuration of 
>One in ccw? 

Hey, it's me writing from different account.

Encouraged and a bit challenged by your post I've just figured out that after removing the 'classes' folder from the buildpath (and deleting it!) ClojureScript One started working normally. At least with the dev-server; (go) command just won't work because of repls incompatibility. 

It seems that this project has some problems with CCW AOT compilation. When I simply run Clojure app from CCW, load one/sample/repl.clj file into repl, switch to one.sample.repl namespace and run (dev-server) ClojureScript compiles well and app works.

I would be interested in the others' opinion.

Cheers,
Daniel
Reply all
Reply to author
Forward
0 new messages