fleet icon indicating copy to clipboard operation
fleet copied to clipboard

What to specify for root-path with fleet-ns when deploying with compojure/ring as a servlet?

Open pgp44 opened this issue 15 years ago • 4 comments

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

pgp44 avatar Mar 23 '11 09:03 pgp44

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.

Flamefork avatar Mar 23 '11 13:03 Flamefork

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

pgp44 avatar Mar 23 '11 17:03 pgp44

I promise to make something usable for this use case :)

Flamefork avatar Mar 24 '11 08:03 Flamefork

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

pgp44 avatar Mar 24 '11 15:03 pgp44