plexus / chestnut

Application template for Clojure + ClojureScript web apps
Eclipse Public License 1.0
1.32k stars 99 forks source link

java.io.FileNotFoundException: Could not locate my_app/server__init.class or my_app/server.clj on classpath #239

Closed dibenso closed 5 years ago

dibenso commented 5 years ago

From a freshly generated app created by:

lein new chestnut my-app +garden +rum +http-kit

When I do:

lein with-profile -dev,+production uberjar && foreman start

I get:

Compiling my-app.application
Compiling my-app.components.server-info
Compiling my-app.config
Compiling my-app.routes
Compiling my-app.styles
Compiling my-app.common
Compiling ClojureScript...
Compiling ["resources/public/js/compiled/my_app.js"] from ["src/cljs" "src/cljc"]...
Successfully compiled ["resources/public/js/compiled/my_app.js"] in 41.923 seconds.
Garden: compiling #'my-app.styles/style
Wrote: resources/public/css/style.css
Created /Users/dibenso/repos/my-app/target/my-app-0.1.0-SNAPSHOT.jar
Created /Users/dibenso/repos/my-app/target/my-app.jar
13:29:07 web.1  | started with pid 57572
13:29:08 web.1  | Exception in thread "main" java.io.FileNotFoundException: Could not locate my_app/server__init.class or my_app/server.clj on classpath. Please check that namespaces with dashes use underscores in the Clojure file name.
13:29:08 web.1  |   at clojure.lang.RT.load(RT.java:463)
13:29:08 web.1  |   at clojure.lang.RT.load(RT.java:426)
13:29:08 web.1  |   at clojure.core$load$fn__6548.invoke(core.clj:6046)
13:29:08 web.1  |   at clojure.core$load.invokeStatic(core.clj:6045)
13:29:08 web.1  |   at clojure.core$load.doInvoke(core.clj:6029)
13:29:08 web.1  |   at clojure.lang.RestFn.invoke(RestFn.java:408)
13:29:08 web.1  |   at clojure.core$load_one.invokeStatic(core.clj:5848)
13:29:08 web.1  |   at clojure.core$load_one.invoke(core.clj:5843)
13:29:08 web.1  |   at clojure.core$load_lib$fn__6493.invoke(core.clj:5888)
13:29:08 web.1  |   at clojure.core$load_lib.invokeStatic(core.clj:5887)
13:29:08 web.1  |   at clojure.core$load_lib.doInvoke(core.clj:5868)
13:29:08 web.1  |   at clojure.lang.RestFn.applyTo(RestFn.java:142)
13:29:08 web.1  |   at clojure.core$apply.invokeStatic(core.clj:659)
13:29:08 web.1  |   at clojure.core$load_libs.invokeStatic(core.clj:5925)
13:29:08 web.1  |   at clojure.core$load_libs.doInvoke(core.clj:5909)
13:29:08 web.1  |   at clojure.lang.RestFn.applyTo(RestFn.java:137)
13:29:08 web.1  |   at clojure.core$apply.invokeStatic(core.clj:659)
13:29:08 web.1  |   at clojure.core$require.invokeStatic(core.clj:5947)
13:29:08 web.1  |   at clojure.main$main_opt.invokeStatic(main.clj:317)
13:29:08 web.1  |   at clojure.main$main_opt.invoke(main.clj:313)
13:29:08 web.1  |   at clojure.main$main.invokeStatic(main.clj:424)
13:29:08 web.1  |   at clojure.main$main.doInvoke(main.clj:387)
13:29:08 web.1  |   at clojure.lang.RestFn.applyTo(RestFn.java:137)
13:29:08 web.1  |   at clojure.lang.Var.applyTo(Var.java:702)
13:29:08 web.1  |   at clojure.main.main(main.java:37)
13:29:09 web.1  | exited with code 1
13:29:09 system | sending SIGTERM to all processes

Step to reproduce:

lein new chestnut my-app +garden +rum +http-kit
cd my-app
lein with-profile -dev,+production uberjar && foreman start

Any help would be greatly appreciated

featheredtoast commented 5 years ago

Heya, thanks for the report - curious, does this work in the latest snapshot version?

Add --snapshot to your lein new command - I am pretty sure this has to do with the changing procfile in a recent version.

Regardless, a new chestnut release is overdue - I'll be able to patch things up and get it out soon.

dibenso commented 5 years ago

Thanks for the quick reply. Unfortunately, adding --snapshot to lein new did not do the trick.

featheredtoast commented 5 years ago

I've just cut a new version (including fixes for this) and tested this and it's working here. Let me know if you're still having any further issues!