Question

After getting counterclockwise working on my Eclipse setup and GAE development server running in interactive mode I found these things still unclear for me:

1) How can I start server and application without commanding it on REPL?

2) When I deploy application to Google servers, how and where do I define the entry point of application? I mean, how Google will know which application, application handlers and routes to use?

3) Can I combine using java classes and clojure files on same project so that both are compiled automatic when creating and editing them on my src folder?

4) Which files and jars are actually needed for uploading to GAE at the end? Im used to deploy PHP apps to GAE, but here I dont know if I should make jars, include compiled clj files. I also might like to organize files different way than counterclockwise or appengine-magic does, so where do I specify paths to resources and classes?

5) Finally is it possible to connect Google production server with Emacs - Slime - Swank combination? That would be the fulfill of dreams, lol.

I'm using appengine-magic with Jetty, Compojure, Ring and Hiccup.

Was it helpful?

Solution

I'm going to suggest a lein/appengine-magic/Eclipse hybrid approach. Create your GAE project with appengine-magic and then set it up in Eclipse.

  1. Create a Clojure "Run Configuration" and check the source files you need evaluated to bring the server up. You will get a REPL to it when it starts.
  2. Your GAE entry point is your web.xml server-class, which refers to the ahead-of-time compiled source in app_servlet.clj (assuming you used lein appengine-new to create the project originally). Look in app_servlet.clj for the call to make-servlet-service-method -- the argument there is your App Engine Magic (see def-appengine-app in core.clj) entry point. In turn that refers to your Compojure handler and routes. See https://github.com/gcv/appengine-magic for the details.
  3. I have not done this, so cannot comment.
  4. Let appengine-magic take care of this: lein appengine-magic prepare, then deploy the deploy the war directory appcfg.sh (which you can find in the GAE Java SDK). You may also be able to use the GAE Eclipse plugins to achieve this.
  5. You cannot use sockets with GAE. Swank depends on sockets, so a REPL to your live application is not possible. You can REPL all you like with the dev server however.

OTHER TIPS

Q 1 & 2 were eventually solved and cleared.

Q 3 I wasnt able to do it because either java or clojure classes overwrote each other and I couldnt change target directories for them separately.

Q 4 after first succesfull deployment now I know what are the core base jars to be included. Yes it depends on what you happen to use on your project. I think I have transferred way too many unnecessary files on PHP deployments.

Q 5 Thats what I thought. But I didnt get swank working on dev app engine server. Its reporting illegal access to some appengine sdk file. Maybe I need to include it on project libs...

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top