Fork me on GitHub
#luminus
<
2017-05-30
>
vetalik12:05:25

Hello! Need more help. What does this mean: Warning: The Main-Class specified does not exist within the jar. It may not be executable as expected. A gen-class directive may be missing in the namespace which contains the main method, or the namespace has not been AOT-compiled.? App runs from lein run but not uberjar or uberwar. Was running ok two days ago. So i did some breaking change. But this message is totally uninformative

vetalik12:05:16

java -jar target/uberjar/aaa-0.1.0-SNAPSHOT.jar 
Error: Could not find or load main class aaa.core

jmayaalv12:05:04

check your project.clj file. there should be a main function configured with the key :main

vetalik12:05:48

it is default one: :main ^:skip-aot aaa.core

jmayaalv12:05:58

check that namespace, does it have a (:gen-class) in the namespace definition?

vetalik12:05:37

I have this (:gen-class) in env/dev/clj/aaa/core.clj

vetalik12:05:04

i think i have Database connectivity exception hidden somewhere

jmayaalv12:05:20

do you have any other aaa.core.clj ? this is on your dev prorfile so it’s only loaded on dev. if the code is something you want to have available on all envriments it should not be on /env. it shoudl be on src/clj/aaa/core.clj

vetalik12:05:11

i have only in : src/clj/aaa/db/core.clj

jmayaalv12:05:02

that’s a different one. So my guess is that the aaa.core.clj file is in the wrong directory.

vetalik12:05:17

Looks like my ojdbc.jar not loaded, even if it is added to the jar and war, and that app can't init db/core.clj due to lost library. prpbably i need to fix Class path

vetalik13:05:44

My error was to assume that if i run lein new luminus +mysql +htt-kit +swagger +<etc> it will generate everything correct. But unfortunately it lost core.clj and some dependencies. But now looks like it is up and runnign again.

jmayaalv13:05:18

that’s looks like a bug on the luminus template

vetalik14:05:27

as an example lein new luminus aaa +http-kit +swagger +h2 +war will produce something that will fail to start as java -jar <path/to/aaa.jar>

jtth14:05:35

is there a guide anywhere about how to get immutant/luminus working with https (self-signed for now)? the immutant docs say it’s “beyond the scope of the documentation” which is a little worrying.

sveri21:05:55

@jtth I know its not exactly what you have been asking for, but, what I did some time ago is to use nginx as proxy for a clojure app and then use letsencrypt for nginx. After some fiddling I got it working.

sveri21:05:59

The advantage is that you dont have to mess around with the java key store and you get a real certificate

jtth21:05:09

@sveri really? is that a normal thing?

jtth21:05:05

oh dear i just looked on SO and that does seem to be the answer…

sveri21:05:33

You can definitly get it working with immutant directly

jtth21:05:06

Yeah, I found https://stackoverflow.com/questions/18432832/how-do-you-enable-https-and-http-https-redirects-in-ring-compojure which seems to say there is another way that seems… okay. Oh well, at least I see options now.

sveri21:05:39

@jtth Like I said, there are different ways. This is my nginx config for one of the sites I have: https://pastebin.com/W8BbqR0f

sveri21:05:54

you have to follow the letsencrypt tutorial to get it working

sveri21:05:05

My app runs as uberjar on port 3123

sveri21:05:42

nginx then forwards the domain http://foo.de to https://foo.de and this to the app running on port 3123

jtth21:05:02

thanks! I just found http://www.luminusweb.net/docs/deployment.md#setting_up_ssl too, so now I see my choices.