This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-04-25
Channels
- # announcements (4)
- # babashka (3)
- # beginners (79)
- # biff (4)
- # calva (17)
- # cider (18)
- # clj-kondo (21)
- # cljdoc (45)
- # cljs-dev (14)
- # cljsrn (9)
- # clojure (90)
- # clojure-europe (86)
- # clojure-italy (3)
- # clojure-nl (3)
- # clojure-portugal (1)
- # clojure-uk (9)
- # clojurescript (20)
- # code-reviews (23)
- # conjure (14)
- # cursive (12)
- # datascript (12)
- # emacs (5)
- # events (2)
- # fulcro (13)
- # gratitude (1)
- # holy-lambda (9)
- # lambdaisland (2)
- # malli (6)
- # nbb (1)
- # nextjournal (2)
- # nrepl (30)
- # off-topic (63)
- # pathom (1)
- # portal (24)
- # reagent (5)
- # reitit (13)
- # releases (2)
- # remote-jobs (1)
- # sci (90)
- # shadow-cljs (49)
- # spacemacs (5)
- # sql (13)
- # testing (20)
- # tools-build (17)
- # xtdb (27)
Hey, everyone! it's me again 😅
After a bunch of "--initialize-at-build-time=javax"
-like blacklisting - my project seems to be building properly. However, if I try to run the jar in openjdk:latest
- it complains about the missing runtime.
$ docker run -v $PWD:/tmp -it openjdk:latest /bin/bash
bash-4.4# cd /tmp
bash-4.4# java -jar .holy-lambda/build/output.jar "my-ns.ExampleLambda"
What I get is:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "String.toString()" because "runtime" is null
Am I missing something?Yeah. You cannot run the lambda from jar. The reason for this is your environment is not AWS Lambda Runtime.
You can either emulate the runtime via sam local or deploy the lambda on real environment.
Btw, why do you create a native artifact if you’re using Java runtime?
Ohhhhh, right 😅 the execution must be tested with sam local invoke ExampleLambdaFunction
! my bad, now it runs.
As for the Java runtime - I used it for testing purposes because I can not run dynamically compiled binaries on my NixOS installation. For some reason, there's a Dockerfile with openjdk:latest
as its base in the native project.
Thanks for the help 😅
But the dynamically compiled binaries are run via sam local invoke, so it should work even on NIX.
In fact, it does 🙂
thanks again!
Yeah. Dockerfile is only for Java. Anyway I’m revamping the layers support so soon it should be much easier to use HL with Java.