luminus-framework / luminus-template

a template project for the Luminus framework
http://www.luminusweb.net/
MIT License
648 stars 147 forks source link

java.io.FileNotFoundException: Could not locate env__init.class, env.clj or env.cljc on classpath. #458

Open 0x4d6165 opened 4 years ago

0x4d6165 commented 4 years ago

Hi! I just setup a new project with the options +aleph +reitit +auth +postgresql +cljs +re-frame +graphql +boot +kibit but I'm getting on odd error on build run

java.io.FileNotFoundException: Could not locate redblackrose/env__init.class, redblackrose/env.clj or redblackrose/env.cljc on classpath.
   clojure.lang.ExceptionInfo: Could not locate redblackrose/env__init.class, redblackrose/env.clj or redblackrose/env.cljc on classpath.
yogthos commented 4 years ago

This looks like there's an outdated dependency somewhere. Some library is looking for the redblackrose.env namespace and not seeing it.

0x4d6165 commented 4 years ago

Hmm, I just generated the project so that's odd. Is this perhaps an error in the template? Also how should I go about figuring out which dependency is outdated and how should I replace it? (I'm a newbie to Clojure but not to programming.)

yogthos commented 4 years ago

Yeah, it looks like there might be an issue with the combination of the options selected. I'm not seeing the same issue without the +boot flag though, so I'd recommend going with Leiningen for now by omitting it.

I don't use boot myself, so not too familiar with troubleshooting it. However, with Leiningen you can use lein-ancient to see if there are any outdated dependencies in the project.

If you have more of the stacktrace available, then we could see what library is trying to call the redblackrose.env namespace. Then we'll have an idea of which library is causing the issue.

0x4d6165 commented 4 years ago

Alright! The full stacktrace is

                              java.lang.Thread.run              Thread.java:  748
java.util.concurrent.ThreadPoolExecutor$Worker.run  ThreadPoolExecutor.java:  624
 java.util.concurrent.ThreadPoolExecutor.runWorker  ThreadPoolExecutor.java: 1149
               java.util.concurrent.FutureTask.run          FutureTask.java:  266
                                               ...                               
               clojure.core/binding-conveyor-fn/fn                 core.clj: 2030
                                 boot.core/boot/fn                 core.clj: 1033
                                               ...                               
                         boot.core/construct-tasks                 core.clj:  973
                         boot.core/construct-tasks                 core.clj:  995
                                clojure.core/apply                 core.clj:  665
                                               ...                               
              boot.user$eval4130$fn__4131.doInvoke                         :  130
                                clojure.core/apply                 core.clj:  667
                                               ...                               
              boot.user$eval4091$fn__4092.doInvoke                         :  121
                                               ...                               
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5969
                            clojure.core/load-libs                 core.clj: 5985
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5928
                             clojure.core/load-lib                 core.clj: 5947
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-one                 core.clj: 5908
                                               ...                               
                                 clojure.core/load                 core.clj: 6109
                                 clojure.core/load                 core.clj: 6125
                              clojure.core/load/fn                 core.clj: 6126
                                               ...                               
                        redblackrose.core/eval4783                 core.clj:    1
        redblackrose.core/eval4783/loading--auto--                 core.clj:    1
                                               ...                               
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5969
                            clojure.core/load-libs                 core.clj: 5985
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5928
                             clojure.core/load-lib                 core.clj: 5947
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-one                 core.clj: 5908
                                               ...                               
                                 clojure.core/load                 core.clj: 6109
                                 clojure.core/load                 core.clj: 6125
                              clojure.core/load/fn                 core.clj: 6126
                                               ...                               
                     redblackrose.handler/eval4789              handler.clj:    1
     redblackrose.handler/eval4789/loading--auto--              handler.clj:    1
                                               ...                               
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5969
                            clojure.core/load-libs                 core.clj: 5985
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5928
                             clojure.core/load-lib                 core.clj: 5947
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-one                 core.clj: 5908
                                               ...                               
                                 clojure.core/load                 core.clj: 6109
                                 clojure.core/load                 core.clj: 6125
                              clojure.core/load/fn                 core.clj: 6126
                                               ...                               
                  redblackrose.middleware/eval4795           middleware.clj:    1
  redblackrose.middleware/eval4795/loading--auto--           middleware.clj:    1
                                               ...                               
                              clojure.core/require                 core.clj: 6007 (repeats 2 times)
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                            clojure.core/load-libs                 core.clj: 5969
                            clojure.core/load-libs                 core.clj: 5985
                                clojure.core/apply                 core.clj:  667
                                               ...                               
                             clojure.core/load-lib                 core.clj: 5928
                             clojure.core/load-lib                 core.clj: 5947
                          clojure.core/load-lib/fn                 core.clj: 5948
                             clojure.core/load-one                 core.clj: 5908
                                               ...                               
                                 clojure.core/load                 core.clj: 6109
                                 clojure.core/load                 core.clj: 6125
                              clojure.core/load/fn                 core.clj: 6126
                                               ...                               
java.io.FileNotFoundException: Could not locate redblackrose/env__init.class, redblackrose/env.clj or redblackrose/env.cljc on classpath.
   clojure.lang.ExceptionInfo: Could not locate redblackrose/env__init.class, redblackrose/env.clj or redblackrose/env.cljc on classpath.
    line: 1
yogthos commented 4 years ago

Is redblackrose the name of your project by any chance?

0x4d6165 commented 4 years ago

Yes

yogthos commented 4 years ago

Ah ok, so it looks like there might be a problem with boot setup in the template then. @DonyorM any chance you could take a look at this? :)

zendevil commented 4 years ago

I'm getting the same error using +boot.

nfedyashev commented 4 years ago

First error that I see after running boot run for the 1st time :

java.nio.file.NoSuchFileException: src/cljc

```code boot run boot.App.main App.java: 500 boot.App.runBoot App.java: 407 org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 145 org.projectodd.shimdandy.impl.ClojureRuntimeShimImpl.invoke ClojureRuntimeShimImpl.java: 154 ... boot.main/-main main.clj: 216 boot.main/-main/fn main.clj: 216 clojure.core/load-string core.clj: 4089 clojure.core/load-reader core.clj: 4087 ... boot.user$eval3406.invoke : 4 boot.user$eval3406.invokeStatic : 4 ... boot.core/set-env! core.clj: 861 boot.core/set-env! core.clj: 876 ... clojure.core/swap! core.clj: 2345 clojure.core/swap! core.clj: 2355 ... boot.core/init!/fn core.clj: 777 boot.core/configure!* core.clj: 311 ... boot.core/eval1037/fn core.clj: 797 boot.core/set-user-dirs! core.clj: 198 boot.core/sync-user-dirs! core.clj: 139 ... boot.core/patch! core.clj: 698 boot.core/patch! core.clj: 724 clojure.core/reduce core.clj: 6828 clojure.core.protocols/fn/G protocols.clj: 13 clojure.core.protocols/fn protocols.clj: 75 clojure.core.protocols/iter-reduce protocols.clj: 49 boot.core/patch!/merge' core.clj: 722 ... boot.filesystem/mktree filesystem.clj: 113 ... boot.file/walk-file-tree file.clj: 59 java.nio.file.Files.walkFileTree Files.java: 2795 java.nio.file.FileTreeWalker.walk FileTreeWalker.java: 322 java.nio.file.FileTreeWalker.visit FileTreeWalker.java: 276 java.nio.file.FileTreeWalker.getAttributes FileTreeWalker.java: 225 java.nio.file.Files.readAttributes Files.java: 1842 sun.nio.fs.UnixFileSystemProvider.readAttributes UnixFileSystemProvider.java: 149 sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes UnixFileAttributeViews.java: 55 sun.nio.fs.UnixException.rethrowAsIOException UnixException.java: 116 sun.nio.fs.UnixException.rethrowAsIOException UnixException.java: 111 sun.nio.fs.UnixException.translateToIOException UnixException.java: 92 java.nio.file.NoSuchFileException: src/cljc file: "src/cljc" clojure.lang.ExceptionInfo: src/cljc line: 3 ```

Not sure if that's a proper workaroundbut if I run mkdir src/cljc I can get to the the next one:

java.io.FileNotFoundException: Could not locate bootluminus/env__init.class, bootluminus/env.clj or bootluminus/env.cljc on classpath.

```code boot run java.lang.Thread.run Thread.java: 830 java.util.concurrent.ThreadPoolExecutor$Worker.run ThreadPoolExecutor.java: 628 java.util.concurrent.ThreadPoolExecutor.runWorker ThreadPoolExecutor.java: 1128 java.util.concurrent.FutureTask.run FutureTask.java: 264 ... clojure.core/binding-conveyor-fn/fn core.clj: 2030 boot.core/boot/fn core.clj: 1033 ... boot.core/construct-tasks core.clj: 973 boot.core/construct-tasks core.clj: 995 clojure.core/apply core.clj: 665 ... boot.user$eval4126$fn__4127.doInvoke : 115 clojure.core/apply core.clj: 667 ... boot.user$eval4087$fn__4088.doInvoke : 106 ... clojure.core/require core.clj: 6007 (repeats 2 times) clojure.core/apply core.clj: 667 ... clojure.core/load-libs core.clj: 5969 clojure.core/load-libs core.clj: 5985 clojure.core/apply core.clj: 667 ... clojure.core/load-lib core.clj: 5928 clojure.core/load-lib core.clj: 5947 clojure.core/load-lib/fn core.clj: 5948 clojure.core/load-one core.clj: 5908 ... clojure.core/load core.clj: 6109 clojure.core/load core.clj: 6125 clojure.core/load/fn core.clj: 6126 ... bootluminus.core/eval4779 core.clj: 1 bootluminus.core/eval4779/loading--auto-- core.clj: 1 ... clojure.core/require core.clj: 6007 (repeats 2 times) clojure.core/apply core.clj: 667 ... clojure.core/load-libs core.clj: 5969 clojure.core/load-libs core.clj: 5985 clojure.core/apply core.clj: 667 ... clojure.core/load-lib core.clj: 5928 clojure.core/load-lib core.clj: 5947 clojure.core/load-lib/fn core.clj: 5948 clojure.core/load-one core.clj: 5908 ... clojure.core/load core.clj: 6109 clojure.core/load core.clj: 6125 clojure.core/load/fn core.clj: 6126 ... bootluminus.handler/eval4785 handler.clj: 1 bootluminus.handler/eval4785/loading--auto-- handler.clj: 1 ... clojure.core/require core.clj: 6007 (repeats 2 times) clojure.core/apply core.clj: 667 ... clojure.core/load-libs core.clj: 5969 clojure.core/load-libs core.clj: 5985 clojure.core/apply core.clj: 667 ... clojure.core/load-lib core.clj: 5928 clojure.core/load-lib core.clj: 5947 clojure.core/load-lib/fn core.clj: 5948 clojure.core/load-one core.clj: 5908 ... clojure.core/load core.clj: 6109 clojure.core/load core.clj: 6125 clojure.core/load/fn core.clj: 6126 ... bootluminus.middleware/eval4791 middleware.clj: 1 bootluminus.middleware/eval4791/loading--auto-- middleware.clj: 1 ... clojure.core/require core.clj: 6007 (repeats 2 times) clojure.core/apply core.clj: 667 ... clojure.core/load-libs core.clj: 5969 clojure.core/load-libs core.clj: 5985 clojure.core/apply core.clj: 667 ... clojure.core/load-lib core.clj: 5928 clojure.core/load-lib core.clj: 5947 clojure.core/load-lib/fn core.clj: 5948 clojure.core/load-one core.clj: 5908 ... clojure.core/load core.clj: 6109 clojure.core/load core.clj: 6125 clojure.core/load/fn core.clj: 6126 ... java.io.FileNotFoundException: Could not locate bootluminus/env__init.class, bootluminus/env.clj or bootluminus/env.cljc on classpath. clojure.lang.ExceptionInfo: Could not locate bootluminus/env__init.class, bootluminus/env.clj or bootluminus/env.cljc on classpath. line: 1 ```

Which looks like build.boot fails to set proper source path to get access to bootluminus.env namespace

Related part of build.boot

```code (deftask dev "Enables configuration for a development setup." [] (set-env! :source-paths #(conj % "env/dev/clj" "src/cljs" "src/cljc" "env/dev/cljs") ```

cat env/dev/clj/bootluminus/env.clj

```clojure (ns bootluminus.env (:require [selmer.parser :as parser] [clojure.tools.logging :as log] [bootluminus.dev-middleware :refer [wrap-dev]])) (def defaults {:init (fn [] (parser/cache-off!) (log/info "\n-=[bootluminus started successfully using the development profile]=-")) :stop (fn [] (log/info "\n-=[bootluminus has shut down successfully]=-")) :middleware wrap-dev}) ```

cat ~/.boot/boot.properties

```shell #http://boot-clj.com #Sat May 02 07:11:53 EEST 2020 BOOT_VERSION=2.8.3 BOOT_CLOJURE_VERSION=1.10.1 BOOT_CLOJURE_NAME=org.clojure/clojure ```

lein new luminus bootluminus +postgres +cljs +re-frame +shadow-cljs +boot +auth +basic

@yogthos Perhaps you may give me some ideas on what I can try to make it boot successfully?

yogthos commented 4 years ago

Unfortunately, I'm not too familiar with boot myself. @DonyorM implemented the feature originally, and might be able to help here.

nikolap commented 4 years ago

To help, I think that shadow-cljs support was never fully added for boot inside luminus. I'm sure it's doable, but I'm not familiar at all with boot so would appreciate someone else's help with that.

That said, it might not be the only issue re the boot profile.