rm-hull / programming-enchiladas

A ClojureScript-based HTML5 Canvas and SVG Graphics Playground, much like http://bl.ocks.org/ but specifically for showcasing small ClojuresScript code demos: The underlying agenda is to show how small simple functional programs can generate complex behaviour.
programming-enchiladas.destructuring-bind.org
138 stars 18 forks source link

New gists don't compile properly #4

Open maravillas opened 10 years ago

maravillas commented 10 years ago

See http://programming-enchiladas.destructuring-bind.org/maravillas/5cc973d88a7c95daf456, which is a copy (not a fork) of http://programming-enchiladas.destructuring-bind.org/swannodette/5903001. I receive the following error for any gist I create, even a minimal gist with only a namespace declaration.

Stack trace:

ava.lang.IllegalArgumentException: No implementation of method: :make-reader of protocol: #'clojure.java.io/IOFactory found for class: nil
core_deftype.clj:544    clojure.core/-cache-protocol-fn
io.clj:69   clojure.java.io/fn[fn]
io.clj:102  clojure.java.io/reader
RestFn.java:410 clojure.lang.RestFn.invoke
js_deps.clj:241 cljs.js-deps/goog-dependencies*
AFn.java:152    clojure.lang.AFn.applyToHelper
AFn.java:144    clojure.lang.AFn.applyTo
core.clj:624    clojure.core/apply
core.clj:5846   clojure.core/memoize[fn]
RestFn.java:397 clojure.lang.RestFn.invoke
js_deps.clj:265 cljs.js-deps/js-dependency-index
env.clj:45  cljs.env/default-compiler-env
env.clj:42  cljs.env/default-compiler-env
closure.clj:1110    cljs.closure/build
compiler.clj:34 enchilada.util.compiler/generate-js
compiler.clj:39 enchilada.util.compiler/regenerate-if-stale
canvas.clj:20   enchilada.controllers.canvas/serve-js
canvas.clj:40   enchilada.controllers.canvas/wrap-error-handler
canvas.clj:59   enchilada.controllers.canvas/fn
core.clj:99 compojure.core/make-route[fn]
core.clj:45 compojure.core/if-route[fn]
core.clj:30 compojure.core/if-method[fn]
core.clj:112    compojure.core/routing[fn]
core.clj:2515   clojure.core/some
core.clj:112    compojure.core/routing
RestFn.java:139 clojure.lang.RestFn.applyTo
core.clj:626    clojure.core/apply
core.clj:117    compojure.core/routes[fn]
core.clj:112    compojure.core/routing[fn]
core.clj:2515   clojure.core/some
core.clj:112    compojure.core/routing
RestFn.java:139 clojure.lang.RestFn.applyTo
core.clj:626    clojure.core/apply
core.clj:117    compojure.core/routes[fn]
keyword_params.clj:35   ring.middleware.keyword-params/wrap-keyword-params[fn]
nested_params.clj:84    ring.middleware.nested-params/wrap-nested-params[fn]
params.clj:64   ring.middleware.params/wrap-params[fn]
multipart_params.clj:118    ring.middleware.multipart-params/wrap-multipart-params[fn]
flash.clj:35    ring.middleware.flash/wrap-flash[fn]
session.clj:98  ring.middleware.session/wrap-session[fn]
gzip.clj:69 ring.middleware.gzip/wrap-gzip[fn]
cache.clj:72    enchilada.middleware.cache/wrap-cache-control[fn]
middleware.clj:12   hiccup.middleware/wrap-base-url[fn]
params.clj:64   ring.middleware.params/wrap-params[fn]
Var.java:379    clojure.lang.Var.invoke
jetty.clj:18    ring.adapter.jetty/proxy-handler[fn]
(Unknown Source)    ring.adapter.jetty.proxy$org.eclipse.jetty.server.handler.AbstractHandler$0.handle
HandlerWrapper.java:116 org.eclipse.jetty.server.handler.HandlerWrapper.handle
Server.java:363 org.eclipse.jetty.server.Server.handle
AbstractHttpConnection.java:483 org.eclipse.jetty.server.AbstractHttpConnection.handleRequest
AbstractHttpConnection.java:920 org.eclipse.jetty.server.AbstractHttpConnection.headerComplete
AbstractHttpConnection.java:982 org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete
HttpParser.java:635 org.eclipse.jetty.http.HttpParser.parseNext
HttpParser.java:235 org.eclipse.jetty.http.HttpParser.parseAvailable
AsyncHttpConnection.java:82 org.eclipse.jetty.server.AsyncHttpConnection.handle
SelectChannelEndPoint.java:628  org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle
SelectChannelEndPoint.java:52   org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run
QueuedThreadPool.java:608   org.eclipse.jetty.util.thread.QueuedThreadPool.runJob
QueuedThreadPool.java:543   org.eclipse.jetty.util.thread.QueuedThreadPool$3.run
Thread.java:744 java.lang.Thread.run
rm-hull commented 10 years ago

When I run the server locally, generally I start it up with:

$ lein ring server-headless

And if I go to http://localhost:3000/maravillas/5cc973d88a7c95daf456 it builds your gist just fine.

So the main difference with the server is that it builds into a standalone uberjar using:

$ JAVA_OPTS= LEIN_SNAPSHOTS_IN_RELEASE=1 lein ring uberjar

and then started with:

$ nohup java -jar  target/programming-enchiladas-0.1.0-standalone.jar 2>&1 >> logs/programming-enchiladas.log &

When run like this, this causes the error you describe. Clearly there is something different in the way the two mechanisms are operating - possibly something to do with AOT compilation not working properly.

I've updated a lot of the old dependencies so we're pretty much up to date, and in the meantime, I've started the server using the lein ring server-headless command, and your gist at http://programming-enchiladas.destructuring-bind.org/maravillas/5cc973d88a7c95daf456 is working as expected.

In the meantime, I'll try and determine what the exact cause.

rm-hull commented 10 years ago

Notes to self

maravillas commented 10 years ago

Interesting. Switching the server command does seem to resolve the issue, at least. Thanks for a handy project!