lein ring server throws error due to older version of hiccup #41

Closed
sathish316 opened this Issue Mar 9, 2012 · 8 comments

Comments

Projects
None yet
3 participants

I'm using hiccup-1.0.1-beta1 with Clojure 1.3.0 and compojure 1.0.1

(defproject Tasks "1.0.0-SNAPSHOT"
  :description ""
  :dependencies [[org.clojure/clojure "1.3.0-beta1"]
                 [compojure "1.0.1"]
                 [hiccup "1.0.0-beta1"]]
  :dev-dependencies [[lein-ring "0.5.4"]]
  :ring {:handler tasks.core/app})

Using hiccup 1.0.1-beta1 with ring handler results in the below error:

Caused by: java.lang.IllegalAccessError: defelem does not exist
    at clojure.core$refer.doInvoke(core.clj:3754)
    at clojure.lang.RestFn.applyTo(RestFn.java:139)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_lib.doInvoke(core.clj:5243)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5262)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5354)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at hiccup.page_helpers$eval430$loading__4531__auto____431.invoke(page_helpers.clj:1)
    at hiccup.page_helpers$eval430.invoke(page_helpers.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6406)

This stackoverflow question says, it's because of ring-devel using an older version of hiccup-0.3.7.jar in lib/dev

http://stackoverflow.com/questions/9572150/hiccup-1-0-0-beta1-error

After excluding hiccup in lein-ring:

 :dev-dependencies [[lein-ring "0.5.4" :exclusions [hiccup]]]

I'm still getting an error

Caused by: java.io.FileNotFoundException: Could not locate hiccup/page_helpers__init.class or hiccup/page_helpers.clj on classpath: 
    at clojure.lang.RT.load(RT.java:430)
    at clojure.lang.RT.load(RT.java:398)
    at clojure.core$load$fn__4636.invoke(core.clj:5377)
    at clojure.core$load.doInvoke(core.clj:5376)
    at clojure.lang.RestFn.invoke(RestFn.java:408)
    at clojure.core$load_one.invoke(core.clj:5191)
    at clojure.core$load_lib.doInvoke(core.clj:5228)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:602)
    at clojure.core$load_libs.doInvoke(core.clj:5262)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:604)
    at clojure.core$use.doInvoke(core.clj:5354)
    at clojure.lang.RestFn.invoke(RestFn.java:482)
    at ring.middleware.stacktrace$eval96$loading__4531__auto____97.invoke(stacktrace.clj:1)
    at ring.middleware.stacktrace$eval96.invoke(stacktrace.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:6406)

Can you please fix this issue?

Owner

weavejester commented Mar 9, 2012

It's not possible to fix this for Ring 1.0. You'll need to wait until Ring 1.1 is released, which will depend on Hiccup 1.0. Until then, use Hiccup 0.3.8, which is the latest stable version.

weavejester closed this Mar 9, 2012

Owner

weavejester commented Mar 9, 2012

I'm hoping to get Ring 1.1 done in a few weeks, so you shouldn't have to wait too long.

Also, the only real difference between Ring 0.3.8 and Ring 1.0 are the names of the namespaces.

I'm running into this issue today with lein-ring 0.6.6 and hiccup 1.0.0 and compojure 1.0.3 and ring-1.1.0. My stacktrace is getting truncated so I can't really see the origin.

lein2 ring server-headless ...

Owner

weavejester commented May 1, 2012

This is a lein-ring issue. I'll release lein-ring 0.7.0 tonight to make it work with Ring 1.1.0.

Owner

weavejester commented May 1, 2012

Or maybe tomorrow night... :)

Until then you should be able to work around it by adding a explicit [ring/ring-devel 1.1.0] dependency to your project.clj file.

Hmm, we already have that in there. Let me know if I can help debug this.

I am using some checkouts/ with lein2. I think there is a phantom reference to old version of hiccup somewhere... but it's not in our code...

Owner

weavejester commented May 1, 2012

What's the stacktrace for it?

You could also try lein classpath to get a list of all the jars loaded by Leiningen into the classpath.

And now it's working... In looking through the git log, I had ring-devel 1.1.0 the whole time. I'll let you know if there are more issues. Thanks for your quick response.

ddellacosta referenced this issue in edgecase/dieter Feb 3, 2013

Closed

Hiccup dependency problem #34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment