Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load-views-ns doesn't work #53

Open
gzeureka opened this issue Dec 14, 2011 · 7 comments
Open

load-views-ns doesn't work #53

gzeureka opened this issue Dec 14, 2011 · 7 comments

Comments

@gzeureka
Copy link

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

<File D:\resin\resin-3.1.9-clojure\lib\activation.jar> #<File D:\resin\resin-

3.1.9-clojure\lib\ejb-15.jar> #<File D:\resin\resin-3.1.9-clojure\lib\hessian.ja
r> #<File D:\resin\resin-3.1.9-clojure\lib\j2ee-management-10.jar> #<File D:\res
in\resin-3.1.9-clojure\lib\javamail-141.jar> #<File D:\resin\resin-3.1.9-clojure
\lib\jaxrpc-15.jar> #<File D:\resin\resin-3.1.9-clojure\lib\jaxws-api.jar> #<Fil
e D:\resin\resin-3.1.9-clojure\lib\jca-15.jar> #<File D:\resin\resin-3.1.9-cloju
re\lib\jms-11.jar> #<File D:\resin\resin-3.1.9-clojure\lib\jpa-15.jar> #<File D:
\resin\resin-3.1.9-clojure\lib\jsdk-15.jar> #<File D:\resin\resin-3.1.9-clojure
lib\jsf-12.jar> #<File D:\resin\resin-3.1.9-clojure\lib\jsr88.jar> #<File D:\res
in\resin-3.1.9-clojure\lib\jstl-11.jar> #<File D:\resin\resin-3.1.9-clojure\lib
jta-101.jar> #<File D:\resin\resin-3.1.9-clojure\lib\jws-15.jar> #<File D:\resin
\resin-3.1.9-clojure\lib\mysql-connector-java-5.1.11-bin.jar> #<File D:\resin\re
sin-3.1.9-clojure\lib\ojdbc6.jar> #<File D:\resin\resin-3.1.9-clojure\lib\portle
t-10.jar> #<File D:\resin\resin-3.1.9-clojure\lib\quercus.jar> #<File D:\resin\r
esin-3.1.9-clojure\lib\resin-deploy.jar> #<File D:\resin\resin-3.1.9-clojure\lib
\resin-util.jar> #<File D:\resin\resin-3.1.9-clojure\lib\saaj.jar> #<File D:\res
in\resin-3.1.9-clojure\lib\script-10.jar> #<File D:\resin\resin-3.1.9-clojure\li
b\sqljdbc4.jar> #<File D:\resin\resin-3.1.9-clojure\lib\webbeans-16.jar> #<File
D:\resin\resin-3.1.9-clojure\lib\webutil.jar>)

And clue to this issue? Is it related to (clojure.lang.RT/baseLoader) ?

@ibdknox
Copy link
Member

ibdknox commented Dec 14, 2011

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

@gzeureka
Copy link
Author

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.

@Raynes
Copy link
Member

Raynes commented May 8, 2012

This will probably be fixed if we start using bultitude. I'll make that change soon and let you know.

@gzeureka
Copy link
Author

gzeureka commented May 8, 2012

That's awesome! Looking forward to it.

在 2012-5-8,下午2:52,Anthony [email protected] 写道:

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

@Raynes
Copy link
Member

Raynes commented May 9, 2012

@gzeureka Could you try out beta5 for me and see if it works? I moved to bultitude.

@gzeureka
Copy link
Author

gzeureka commented May 9, 2012

Sorry Raynes, I tried beta5 but the problem still persists.

@Raynes
Copy link
Member

Raynes commented May 9, 2012

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants