Open gzeureka opened 12 years ago
In a war, the only thing that will work is requiring the views explicitly at the top of your file. See this previous issue: https://github.com/ibdknox/noir/issues/26
Thanks Chris.
Well, I found out that it's caused by the classpath-directories function defined in clojure.java.classpath:
(defn classpath-directories
"Returns a sequence of File objects for the directories on classpath."
[]
(filter #(.isDirectory ^File %) (classpath)))
it calls classpath function without argument which will call (clojure.lang.RT/baseLoader) , I modify it to
(defn classpath-directories
"Returns a sequence of File objects for the directories on classpath."
[]
(filter #(.isDirectory ^File %) (classpath (.getContextClassLoader (Thread/currentThread))))
then load-views-ns works. I don't know whether it is feasible.
This will probably be fixed if we start using bultitude. I'll make that change soon and let you know.
That's awesome! Looking forward to it.
在 2012-5-8,下午2:52,Anthony Grimesreply@reply.github.com 写道:
This will probably be fixed if we start using bultitude. I'll make that change soon and let you know.
Reply to this email directly or view it on GitHub: https://github.com/ibdknox/noir/issues/53#issuecomment-5568556
@gzeureka Could you try out beta5 for me and see if it works? I moved to bultitude.
Sorry Raynes, I tried beta5 but the problem still persists.
Obviously the work of Satan. I'll take a look. I figured it would work because I'm pretty sure it looks in like 2309523423423ERRORERROR classpaths.
I have add this to server.clj (server/load-views-ns 'test.views)
and use lein ring uberwar to deploy to Resin, but it results in "We seem to have lost that one. Since we couldn't find the page you were looking for, check to make sure the address is correct." for /welcome. And I digged further to find out that (println "classpath " (classpath/classpath)) the classpath wasn't setup correctly. The classpath is as follow: classpath (#<File D:\resin\resin-3.1.9-clojure\lib\resin.jar> #<File D:\resin\r esin-3.1.9-clojure\classes> #<File D:\resin\resin-3.1.9-clojure\lib\resin.jar> # <File d:\jdk\jdk1.7.0_01\lib\tools.jar> #<File d:\jdk\jdk1.7.0_01\jre\lib\rt.jar
And clue to this issue? Is it related to (clojure.lang.RT/baseLoader) ?