Ok, I've got a simple web application that works running on embedded
jetty using the ring jetty adapter. I would now like to deploy it in
an infrastructure that will restart it if it dies, the system reboots,
etc. I've already got tomcat doing most of that, so the obvious choice
is a WAR file. Trouble is, trying the obvious thing from the
documentation doesn't work. The examples I find on the web all either
fail the same way, don't build (given that this is all new and still
rapidly evolving software, understandable), or involve using another
level of software. I chose ring because it looked like I could use
ring handlers in a number of different web servers without that extra
level.

Ok, this is the working serlvet.clj file: It picks up the handler from
x10.core, and then runs that:

(ns x10.servlet 
  [:use [x10.core :only (handler)] 
        ring.adapter.jetty
        ring.middleware.reload ring.middleware.stacktrace])
  
(def app
     (-> #'handler
         (wrap-reload '(x10.core))
         (wrap-stacktrace)))

(defn boot [] (run-jetty #'app {:port 8088}))

The goal is to get the same handler running in a server framework.
I'm trying tomcat via a WAR file: based on the ring documentation, I
added war.clj (this is just the latest variant):

(ns x10.war
  [:use [x10.core :only (handler)] 
        ring.util.servlet])
  
(defservice handler)

Then added ring/ring-servlet to the project.clj :dependencies, an
:aout pointing x10.war, and build it using leiningen-war. Deploying
the resulting war file gets tomcat log messages about not being able
to create a SESSIONS.ser file, and a web page complaining that "The
requested resource (/x10/) is not available."

I did try building/deploying the compjure war example, and that at
least shows me the static page, so I believe the tomcat install is
correct.

Anyone got pointers to how to generate a WAR file for a simple
application, or suggestions on how to fix war.clj? Anything else you
might need to see to fix this?

Alternatively, instructions for deploying the same handler on either a
stand-alone (instead of an embedded) jetty, or on httpcore?

   Thanks
   <mike
-- 
Mike Meyer <m...@mired.org>             http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to