Couple questions:
1. Can you describe your Tomcat environment? And do Java servlets run
fine there?
2. Have you ever run a Compojure app in this environment?
3. Last week, at the start of the day the Noir error page was being
returned as text/plain and later in the day it was text/html. What
change did you make for that to happen?
4. Also, last week, at the start of the day, your root url path was
returning the Noir error, in addition to '/beta', then later in the
day '/beta' was returning the Noir error page but '/' was returning a
Tomcat error page. What changed this?
At this point, I'm thinking it might be something with the context
path setup, but need more information.
- Mark
(defpage "/" []
"Hello World 1")
(defpage "/beta" []
"Hello World 2")
I'm assuming you are expecting http://lyrion.ch/beta to return "Hello
World 1" here, but it will return "Hello World 2". If this is the
case, see the thread below:
If these don't correct the problems, if you are able to push your
project to github, I can take a look at it.
- Mark
On Sat, Dec 24, 2011 at 8:15 AM, zilti <dzil...@gmail.com> wrote:
> Has there a solution been found for the problem since the last answer? Sorry
> for digging up this thread, but I didn't have time for working with noir for
> quite some time and now still have that problem. The whole thing does not
> even work locally anymore when adding the [ring "1.0.1"] dependency to the
> project.clj.
(ns lyrionch.server(:require [noir.server :as server][lyrionch.views.welcome][lyrionch.views.whatever-other-views-I-have))
;;(server/load-views "src/lyrionch/views/")(def handler (server/gen-handler {:mode :dev:ns 'lyrionch}))
I suspected the :url-pattern thing [1] so I removed the :url-pattern from the project.cljrebuilt the war and deployed in under ROOT/
Did you try deploying it outside of root without the :url-pattern? I've never heard of that option and it seems to work for me without it. Though I admittedly know very little about tomcat.
Ah, when you start your server, you need to add the :base-url option(server/start 8080 {:base-url "/testsite"})
(defn -main [& m]
(let [mode (keyword (or (first m) :dev))
port (Integer. (get (System/getenv) "PORT" "8080"))]
(server/start port {:mode mode
:ns 'testsite})))
(def handler (server/gen-handler
{:mode :dev
:base-url "/testsite"
:ns 'testsite}))
:base-url "/testsite"
(def handler (server/gen-handler
{:mode :dev