lein appengine-prepare

66 views
Skip to first unread message

Thorsten Wilms

unread,
Mar 21, 2011, 5:26:56 AM3/21/11
to clo...@googlegroups.com
Hi!

After working with appengine-magic a bit, I wanted to use the datastore
viewer to see what's happening. So I tried "lein appengine-prepare" (is
there another way?).

From https://github.com/gcv/appengine-magic#readme:
----
Testing with dev_appserver.sh

1. lein appengine-prepare. This AOT-compiles the entry point servlet,
makes a jar of your application, and copies it, along with all your
library dependencies, to your application's resources/WEB-INF/lib/
directories.

2. Run dev_appserver.sh with a path to your application's resources/
directory.
----

But it fails with: "java.lang.Exception: No such var:
appengine-magic.core/default-war-root (core.clj:64)"

My core.clj:64:
(ae/def-appengine-app tlog-app #'tlog-app-handler)
is exactly like in the readme and another, functioning project called
ackbar.

appengine-magic.core does not contain default-war-root directly, but has
(if (in-appengine-interactive-mode?) (load "core_local") (load
"core_google"))

core_local.clj defn's default-war-root, but core_google.clj doesn't.

Now this can't be called an interactive use, but I wonder if this switch
does exactly what it's supposed to.


On rereading, I have to note that
----
With regard to AOT-compilation, if your project needs it, then you must
include <project>.app_servlet in Leiningen's :aot directive. Otherwise,
omit the :aot directive altogether. The lein appengine-prepare task will
take care of AOT-compiling the entry point servlet and cleaning up
afterwards.
----

Doesn't make it exactly clear to me, whether this :aot directive is
required for appengine-prepare, or not. Adding ":aot tlog.app_servlet"
to me project file makes the "No such var" error go away, but:
----
$: lein appengine-prepare
preparing App Engine application tlog for deployment
Exception in thread "main" java.lang.RuntimeException:
java.lang.IllegalArgumentException: Don't know how to create ISeq from:
clojure.lang.Symbol (NO_SOURCE_FILE:0)
at clojure.lang.Compiler.eval(Compiler.java:5440)
at clojure.lang.Compiler.eval(Compiler.java:5391)
at clojure.core$eval.invoke(core.clj:2382)
at clojure.main$eval_opt.invoke(main.clj:235)
at clojure.main$initialize.invoke(main.clj:254)
at clojure.main$script_opt.invoke(main.clj:270)
at clojure.main$main.doInvoke(main.clj:354)
at clojure.lang.RestFn.invoke(RestFn.java:458)
at clojure.lang.Var.invoke(Var.java:377)
at clojure.lang.AFn.applyToHelper(AFn.java:174)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.main.main(main.java:37)
Caused by: java.lang.RuntimeException:
java.lang.IllegalArgumentException: Don't know how to create ISeq from:
clojure.lang.Symbol
at clojure.lang.LazySeq.sval(LazySeq.java:47)
at clojure.lang.LazySeq.seq(LazySeq.java:56)
at clojure.lang.RT.seq(RT.java:450)
at clojure.core$seq.invoke(core.clj:122)
at leiningen.compile$find_namespaces_by_regex.invoke(compile.clj:36)
at leiningen.compile$compilable_namespaces.invoke(compile.clj:51)
at leiningen.compile$compile.invoke(compile.clj:249)
at
leiningen.appengine_prepare$appengine_prepare.invoke(appengine_prepare.clj:31)
at clojure.lang.Var.invoke(Var.java:365)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:482)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$apply_task.invoke(core.clj:191)
at leiningen.core$_main.doInvoke(core.clj:250)
at clojure.lang.RestFn.applyTo(RestFn.java:138)
at clojure.core$apply.invoke(core.clj:542)
at leiningen.core$_main.invoke(core.clj:255)
at user$eval175.invoke(NO_SOURCE_FILE:1)
at clojure.lang.Compiler.eval(Compiler.java:5424)
... 11 more
Caused by: java.lang.IllegalArgumentException: Don't know how to create
ISeq from: clojure.lang.Symbol
at clojure.lang.RT.seqFrom(RT.java:471)
at clojure.lang.RT.seq(RT.java:452)
at clojure.core$seq.invoke(core.clj:122)
at clojure.core$filter$fn__3714.invoke(core.clj:2130)
at clojure.lang.LazySeq.sval(LazySeq.java:42)
... 29 more
----

This leaves me totally puzzled. Note that my project does compile,
otherwise.

So, do I need :aot, am I stumbling over a bug in appengine-magic, is it
yet another case of having overlooked some detail ...?


--
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/

Thorsten Wilms

unread,
Mar 21, 2011, 10:05:56 AM3/21/11
to clo...@googlegroups.com
nevermind, in the hours it's been since I send this mail, I fixed that
issue (a stray :main in my project file and the need to run "lein clean".

On 03/21/2011 10:26 AM, Thorsten Wilms wrote:
> Hi!
>
> After working with appengine-magic a bit, I wanted to use the datastore
> viewer to see what's happening. So I tried "lein appengine-prepare" (is
> there another way?).
>
> From https://github.com/gcv/appengine-magic#readme:
> ----
> Testing with dev_appserver.sh
>
> 1. lein appengine-prepare. This AOT-compiles the entry point servlet,
> makes a jar of your application, and copies it, along with all your
> library dependencies, to your application's resources/WEB-INF/lib/
> directories.
>
> 2. Run dev_appserver.sh with a path to your application's resources/
> directory.
> ----
>
> But it fails with: "java.lang.Exception: No such var:
> appengine-magic.core/default-war-root (core.clj:64)"

> ...

Constantine Vetoshev

unread,
Mar 22, 2011, 2:20:40 AM3/22/11
to Clojure
On Mar 21, 7:05 am, Thorsten Wilms <t...@freenet.de> wrote:
> nevermind, in the hours it's been since I send this mail, I fixed that
> issue (a stray :main in my project file and the need to run "lein clean".
>
> On 03/21/2011 10:26 AM, Thorsten Wilms wrote:
> >
> > After working with appengine-magic a bit, I wanted to use the datastore
> > viewer to see what's happening. So I tried "lein appengine-prepare" (is
> > there another way?).

I'm glad you sorted out the problem.

If you switch to the testing 0.4.0-SNAPSHOT of appengine-magic, then
the /_ah/admin datastore viewer will work without resorting to
dev_appserver.sh. 0.4.0 makes the viewer available in normal
interactive development mode. Incidentally, I'm close to finalizing
and releasing 0.4.0, so you don't need to worry about stability.
Reply all
Reply to author
Forward
0 new messages