What to specify for root-path with fleet-ns when deploying with compojure/ring as a servlet?
Hello Hello,
I have a simple fleet test running where the templates are located relative to the project directory. This works fine when I start everything under the ring jetty adapter.
However when I want to deploy under tomcat (building the war using using "lein ring uberwar") it always bails out saying it cannot find the fleet generated function.
The only way I can get this to work under tomcat is by specifying an absolute path with the fleet-ns invocation but that is not really the correct way
Is this approach supported? If so, what should I use for the root-path with ns-fleet?
All guidance appreciated!
Thanks
Peter
Hello,
I did not tried to use fleet-ns in this environment, but I see two things that needs to be checked / tried: — Ensure that templates are actually packed into uberwar — Use someYourClass.getClassLoader().getResource(...) to get path to templates dir.
Thanks for your quick response
I continue to struggle with this. I actually do not have a "someYourClass" so I need to get hold of some other class that uses the same classloader as the servlet and that seems less trivial than I like.
I also would like it all to work both in a standalone (jetty) setup and in a war deployed in tomcat. That is also causing some headaches.
And most importantly, I am new to clojure and even more to compojure/ring/fleet and leiningen. That does not help :)
But the tip is good and I will eventually get there ... I hope ;)
Thanks
Peter
I promise to make something usable for this use case :)
I have something working now but I had to add an empty java class to my project just for the sake of new'ing it up and getting hold of its classloader.
A more elegant solutions seems indeed useful in general
Thanks
Peter