jarohen / frodo

A lein plugin to start a Ring server via configuration in Nomad
38 stars 4 forks source link

Exception updating to 0.3.2 #8

Open markjfisher opened 10 years ago

markjfisher commented 10 years ago

I'm getting the following exception going from 0.3.0 to 0.3.2:

Compiling ClojureScript.
Exception in thread "main" java.lang.NoSuchMethodError: clojure.lang.Reflector.invokeNoArgInstanceMember(Ljava/lang/Object;Ljava/lang/String;Z)Ljava/lang/Object;
at nomad$fn__504$fn__505.invoke(nomad.clj:23)
at clojure.lang.AFn.applyToHelper(AFn.java:159)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.core$apply.invoke(core.clj:617)
at clojure.core$memoize$fn__5049.doInvoke(core.clj:5735)
at clojure.lang.RestFn.invoke(RestFn.java:397)
at nomad$fn__504$get_hostname__507.invoke(nomad.clj:22)
at nomad$update_config.invoke(nomad.clj:169)
at clojure.lang.AFn.applyToHelper(AFn.java:161)
at clojure.lang.AFn.applyTo(AFn.java:151)
at clojure.lang.Ref.alter(Ref.java:174)
at clojure.core$alter.doInvoke(core.clj:2244)
at clojure.lang.RestFn.invoke(RestFn.java:425)
at nomad$get_current_config$fn__619.invoke(nomad.clj:179)
at clojure.lang.AFn.call(AFn.java:18)
at clojure.lang.LockingTransaction.run(LockingTransaction.java:263)
at clojure.lang.LockingTransaction.runInTransaction(LockingTransaction.java:231)
at nomad$get_current_config.invoke(nomad.clj:178)
at clojure.lang.Var.invoke(Var.java:415)
at frodo.core$init_frodo_BANG_$_config__1883.invoke(core.clj:9)
at frodo.core$init_frodo_BANG_.invoke(core.clj:11)
    ....
jarohen commented 10 years ago

Thanks for submitting these, will take a look :)

jarohen commented 10 years ago

Hi Mike - at first glance I can't see what's causing this, will need to take a more detailed look.

If you're interested, nomad.clj:23 is the last line of this snippet:

(defmacro ^:private deflocation [name & body]
  `(let [get-real-location# (memoize
                             (fn []
                               ~@body))]
     (defn- ~(symbol (str "get-" name)) []
       (or (get *location-override* (keyword '~name))
           (get-real-location#)))))

(deflocation hostname
  (.trim (:out (sh "hostname"))))

If you can spot what's up, that'd be really useful! Failing that, I'll investigate when I get a moment, but I'm afraid it's unlikely I'll get time until next week or so.

James

jarohen commented 10 years ago

Hmm - there weren't any version bumps in Frodo between 0.3.0 and 0.3.2. Can you confirm that this works on 0.3.0 and fails on 0.3.2 with a clean project each time?

(One of the bigger changes between these two versions was that the frodo.main namespace became AOT compiled, to help with uberjarring)

Cheers,

James

markjfisher commented 10 years ago

It's the clojure version i'm using. Doesn't happen if I include 1.6.0, but 1.5.1 throws the error every time, but only against frodo 0.3.2+. Tested on a simple project with only frodo bits in it.

jarohen commented 10 years ago

Ah, that's useful to know, thanks!

I've just looked through the changelog from 0.3.0 to 0.3.2 and it doesn't introduce anything specific to Clojure 1.6.0; indeed, the code snippet that's causing the exception hasn't changed since Nomad 0.6.1 (current is 0.6.4) - and Frodo updated from 0.6.0 to 0.6.4 between 0.3.0-rc2 and 0.3.0-rc3, so this should manifest itself in 0.3.0 as well.

Strange.

I'll leave this open for a while just in case I or somebody else figures out what's happened, but given 1.6.0 and 1.5.1 are broadly compatible I'm inclined to say that upgrading a Clojure version is a reasonable workaround.

James