I have an existing Java webapp running in Tomcat, to which I add some primitive Clojure support. For the time being, I am simply including Clojure source files as resources in the class path and invoking it through clojure.lang.RT. This is primitive but works great.
However, I noticed that Tomcat WebappClassLoadercaches resources obtained through getResourceAsInputStream()that Clojure uses to extract and compile the source code. That is, it (require 'my-ns :reload)simply reloads the cached version of the file, even if an updated version is available on disk. Is there a way around or avoiding this caching for Clojure files?
The best I came up with after fruitless searches was to use reflection to manually delete a record from WebappClassLoader.resourceEntriesthat which is terrible.
Something is missing for me.
Answers like "using Jetty / Glassfish / JBoss", "restarting Tomcat", etc. not what i'm looking for.
source
share