weavejester / compojure-example Goto Github PK
View Code? Open in Web Editor NEWAn example Compojure project
An example Compojure project
Since the version of lein-ring (0.3.2) specified in project.clj does not work with leningen 1.6.0 or above due to a bug with lein-ring, I changed the lein-ring version to the latest 0.4.5 which fixed the bug. However, the uberwar created with lein-ring 0.4.5 does not work for tomcat. The style.css cannot be found. The war created by 0.3.2 (using leningen 1.5.2) works though.
The difference between the wars created by 0.4.5 and that by 0.3.2 is the location of the "public" directory, it is under WEB-INF/classes for 0.4.5 whereas it is under root for 0.3.2.
I think this creates a difficulty situation for users. Basically, the latest versions of lein-ring and leningen do not work together for compojure-example project.
From the amount of discussions on the groups, it seems the placement of resources to work well for both lein-ring and war deployment is problematic. Could you investigate this more, and create a updated version of this compojure-example project that works with lein-ring 0.4.5?
Upgrade to version 1.1.2 of compojure,
was running "lein ring uberwar", there is no reaction
In 1.1.1 there was no problem.
The compilation, but to sleep in the code below.
Could you confirm? Thank you.
The existing example is too simple. Please consider including examples of session and flash.
I'm getting a StackOverflowError
when running lein ring server
, ending with Subprocess failed
.
The stacktrace looks like this:
Exception in thread "main" java.lang.StackOverflowError
at clojure.lang.APersistentSet.iterator(APersistentSet.java:155)
at clojure.core.protocols$fn__5871.invoke(protocols.clj:73)
at clojure.core.protocols$fn__5828$G__5823__5841.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6030)
at ns_tracker.dependency$transitive.invoke(dependency.clj:15)
at ns_tracker.dependency$transitive$fn__748.invoke(dependency.clj:14)
at clojure.core.protocols$fn__5871.invoke(protocols.clj:76)
at clojure.core.protocols$fn__5828$G__5823__5841.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6030)
at ns_tracker.dependency$transitive.invoke(dependency.clj:15)
at ns_tracker.dependency$transitive$fn__748.invoke(dependency.clj:14)
at clojure.core.protocols$fn__5871.invoke(protocols.clj:76)
at clojure.core.protocols$fn__5828$G__5823__5841.invoke(protocols.clj:13)
at clojure.core$reduce.invoke(core.clj:6030)
at ns_tracker.dependency$transitive.invoke(dependency.clj:15)
at ns_tracker.dependency$transitive$fn__748.invoke(dependency.clj:14)
repeating...
I'm trying to add a web frontend to an existing app. lein run
still works fine. Any ideas? I've been tweaking deps/versions in project.clj
for hours to no avail.
Maybe it would be better to use lein ring server-headless
to run the server as I imagine most people will be running this from a terminal.
When I ran it using lein ring server
I get:
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:207)
at java.awt.Window.<init>(Window.java:536)
at java.awt.Frame.<init>(Frame.java:420)
at java.awt.Frame.<init>(Frame.java:385)
at javax.swing.JFrame.<init>(JFrame.java:181)
at clojure.java.browse_ui$open_url_in_swing.invoke(browse_ui.clj:20)
at clojure.lang.Var.invoke(Var.java:415)
at clojure.java.browse$open_url_in_swing.invoke(browse.clj:44)
at clojure.java.browse$browse_url.invoke(browse.clj:52)
at ring.server.standalone$open_browser_to.invoke(standalone.clj:39)
at ring.server.standalone$serve$fn__1506.invoke(standalone.clj:102)
at ring.server.standalone$try_port.invoke(standalone.clj:16)
at ring.server.standalone$serve.doInvoke(standalone.clj:95)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at ring.server.leiningen$serve.invoke(leiningen.clj:20)
at user$eval2054.invoke(form-init2066820887519135966.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6511)
at clojure.lang.Compiler.eval(Compiler.java:6501)
at clojure.lang.Compiler.load(Compiler.java:6952)
at clojure.lang.Compiler.loadFile(Compiler.java:6912)
at clojure.main$load_script.invoke(main.clj:283)
at clojure.main$init_opt.invoke(main.clj:288)
at clojure.main$initialize.invoke(main.clj:316)
at clojure.main$null_opt.invoke(main.clj:349)
at clojure.main$main.doInvoke(main.clj:427)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:419)
at clojure.lang.AFn.applyToHelper(AFn.java:163)
at clojure.lang.Var.applyTo(Var.java:532)
at clojure.main.main(main.java:37)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.