mercredi 26 août 2015

Clojure ring app on Elastic Beanstalk with Postgres Version errors

I have a clojure ring app which I have previously pushed successfully to Elastic Beainstalk using lein-beanstalk. But now, since I've added PostgreSQL integration I've run into problems.

After deploying, what I get is a runtime exception: java.lang.UnsupportedClassVersionError: org/postgresql/Driver : Unsupported major.minor version 51.0 (unable to load class org.postgresql.Driver)

From what I gather this is a version incompatibility and I'm guessing the Postgres drivers are built with Java 8 even though the documentation says that "9.4-1201-jdbc41" should work on Java 7 as well.

So I've tried a few different things, all of them resulting in the app no longer responding at all. First of all I created I new Elestic Beanstalk environment with Java 8, didn't work. Then I changed to the jdbc4 drivers instead of jdbc41, same result. I've tried adding :javac-options ["-target" "1.8" "-source" "1.8"] to the leinigen project and the same with 1.6. I also tried using "9.4-1200-jdbc41" drivers but I'm not even able to pull in the dependencies for that.

Anyone has any ideas on other things to try. The Java side of clojure deployment and AWS aren't really my forte so I'm trying to keep this as simple as possible.

For completeness, here is the dependency section of the .lein-file:

:dependencies [[org.clojure/clojure "1.6.0"] [liberator "0.12.2"] [ring/ring-core "1.3.2"] [compojure "1.3.4"] [org.clojure/data.json "0.2.6"] [yesql "0.4.2"] [org.postgresql/postgresql "9.4-1201-jdbc41"]] :plugins [[lein-ring "0.9.3"] [lein-beanstalk "0.2.7"]]




Aucun commentaire:

Enregistrer un commentaire