immutant

http://immutant.org Note: dev discussion happens in #immutant on FreeNode IRC.
timgilbert 2016-10-18T22:05:30.000317Z

Hi all, I'm having a little trouble with (wrap-reload) in an AOT-compiled jar

timgilbert 2016-10-18T22:06:31.000318Z

I'm getting the error thrown from here: https://github.com/immutant/immutant/blob/master/web/src/immutant/web/middleware.clj#L37

timgilbert 2016-10-18T22:06:58.000320Z

...but the libraries exist on the classpath

timgilbert 2016-10-18T22:07:45.000321Z

user=> (require '[ring.middleware.reload])
nil
user=> (require '[ring.middleware.stacktrace])
nil
user=> (require '[clojure.java.classpath])
nil
user=> (require '[immutant.internal.util :as u])
nil
user=> (u/try-resolve 'ring.middleware.reload)
nil
user=> (u/require-resolve 'ring.middleware.reload)

NullPointerException   clojure.lang.Symbol.intern (Symbol.java:59)

timgilbert 2016-10-18T22:09:16.000322Z

...actually it looks like the root of the problem is this:

user=> (require (symbol (namespace 'ring.middleware.reload)))

NullPointerException   clojure.lang.Symbol.intern (Symbol.java:59)

2016-10-18T22:10:49.000323Z

@timgilbert sorry you're having trouble. i'm guessing things work when you don't AOT compile?

2016-10-18T22:12:02.000324Z

i'm guessing you may need to explicitly refer to it before you AOT compile it

timgilbert 2016-10-18T22:16:36.000325Z

I haven't actually tried skipping the AOT step, but I'll try it

timgilbert 2016-10-18T22:17:09.000326Z

The weird thing is that almost identical code is running correctly on a different environment, so I'm going to try checking my JVM versions and whatnot

timgilbert 2016-10-18T22:17:24.000327Z

Mostly just wanted to see whether anyone came across this before

timgilbert 2016-10-18T22:17:39.000328Z

This is on Clojure 1.9b13, BTW

timgilbert 2016-10-18T22:18:19.000329Z

If I can boil it down to more useful info I'll write up a ticket

2016-10-18T22:19:10.000330Z

@timgilbert thanks!