aws

http://status.aws.amazon.com/ https://www.expeditedssl.com/aws-in-plain-english
2020-04-01T20:55:29.047600Z

I'm attempting to deploy an uberjar to elastic beanstalk for the first time. I'm using the preconfigured Java platform. I have a main class compiled in my jar and working properly on my local machine, ie I can just do

java -jar MyProject.jar
And it starts up properly (locally). I have uploaded this jar to my beanstalk app. But when I visit the URL I just get a 502 Bad Gateway. the web.log is showing
-------------------------------------
/var/log/web-1.log
-------------------------------------
Clojure 1.6.0
user=>
I'm not seeing clojure 1.6 at all in my deps tree. Any tips on how I can start to debug this? Is there anything else I need to do to prepare the jar?

2020-04-01T22:38:33.048Z

I bet I know

2020-04-01T22:39:03.048700Z

a jar often has a thing called a manifest in it

2020-04-01T22:39:21.049200Z

and in the manifest it might have a Main-Class specified

2020-04-01T22:39:39.049700Z

java -jar looks for the Main-Class in the manifest and runs that

2020-04-01T22:40:05.050200Z

it looks like your jar is specifying clojure.main as the Main-Class, which just starts the clojure repl

2020-04-01T22:40:18.050500Z

which is why you get the repl starting output in the log there

2020-04-01T22:41:03.051100Z

so however you are building your jar isn't setting the Main-Class attribute to whatever your main class is

2020-04-01T23:42:23.052600Z

My manifest.mf in the jar looks like this

Manifest-Version: 1.0
Built-By: depstar
Build-Jdk: 13.0.1
Multi-Release: true
Main-Class: main
where the main namespace is indeed the correct main class (yeah I know horrible name and single segment namespaces are not a good practice... that shouldn't be the issue though right?)

2020-04-01T23:45:11.053600Z

I think I might have to do additional config related stuff for beanstalk instead of just using the regular jar

2020-04-01T23:56:46.054400Z

I would double check that the beanstalk jar is the same one you are looking at locally, because that looks like a jar launched with a main class of clojure.main

2020-04-01T23:57:37.055200Z

or look back over whatever tutorial you are looking at (I assume you are working from some tutorial because you are using clojure 1.6.0)

2020-04-01T23:58:47.056Z

that's the thing though I'm not using clojure 1.6, and it doesn't appear in my deps tree via clj -Stree

2020-04-01T23:59:01.056400Z

you should check what java version you are using locally and in beanstalk

2020-04-01T23:59:16.056900Z

the multi-release thing could trip you up

2020-04-01T23:59:34.057300Z

Using 1.13 locally but I also have it working on another server (via the jar) on 1.8 with no issues

2020-04-01T23:59:47.057600Z

beanstalk is 1.8 I believe