Fork me on GitHub

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
Clojure 1.6.0
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?


I bet I know


a jar often has a thing called a manifest in it


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


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


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


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


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


My 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?)


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


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

Alex Miller (Clojure team)00:04:03

it would say clojure.main then


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)


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


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


the multi-release thing could trip you up


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


beanstalk is 1.8 I believe