Routes redefinition no longer working

40 views
Skip to first unread message

Kevin Lynagh

unread,
Aug 9, 2011, 9:02:07 PM8/9/11
to Compojure
I'm just getting back into using compojure, this time on clojure 1.3.
I have been fighting with trying to redefine my functions and have the
changes show up.
The last time I used compojure this all worked fine, but that was a
few months ago on clojure 1.2, so I'm not sure what has changed.

Here is a minimal example

(defroutes d3-routes
(GET "/" [] (redirect "/index.html"))
(GET "/test" [] "hello.")
(route/resources "/" {:root "dev_public"}))

(def ^:dynamic *app* (-> #'d3-routes
compojure.handler/site))

(use 'ring.adapter.jetty)
(def server (run-jetty #'*app* {:port 8080 :join? false}))


I'll try to redefine the string for the "test" route, but the change
is never reflected, no matter how many times I execute defroutes or
redefine *app*.

Any ideas?

James Reeves

unread,
Aug 13, 2011, 8:38:57 AM8/13/11
to comp...@googlegroups.com
On 10 August 2011 02:02, Kevin Lynagh <kly...@gmail.com> wrote:
> I'm just getting back into using compojure, this time on clojure 1.3.
> I have been fighting with trying to redefine my functions and have the
> changes show up.
> The last time I used compojure this all worked fine, but that was a
> few months ago on clojure 1.2, so I'm not sure what has changed.

I've tried out your example on 1.3.0-beta1, but it seems to reload fine for me.

Here are the exact steps I took: https://gist.github.com/1143808

(For the purposes of reloading, tagging vars as ^:dynamic is unnecessary.)

- James

Kevin Lynagh

unread,
Aug 14, 2011, 10:54:13 AM8/14/11
to Compojure
James,

Thanks for trying this out and providing the minimal example--it works
for me.

After some debugging I figured out what was wrong with my project; I
had the dependency

[compojure "0.6.5" :exclusions [org.clojure/clojure
org.clojure/clojure-contrib]]

but once I changed my monolithic clojure-contrib dependency to the new
modular scheme (i.e., [org.clojure/data.json "0.1.1"]) and removed the
exclusions clause on my compojure dependency, then reloading worked
fine.

Thanks again,

Kevin

On Aug 13, 5:38 am, James Reeves <jree...@weavejester.com> wrote:
> On 10 August 2011 02:02, Kevin Lynagh <klyn...@gmail.com> wrote:
>
> > I'm just getting back into using compojure, this time on clojure1.3.
> > I have been fighting with trying to redefine my functions and have the
> > changes show up.
> > The last time I used compojure this all worked fine, but that was a
> > few months ago on clojure 1.2, so I'm not sure what has changed.
>
> I've tried out your example on1.3.0-beta1, but it seems to reload fine for me.
Reply all
Reply to author
Forward
0 new messages