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?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鈥檓 revamping the layers support so soon it should be much easier to use HL with Java.
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鈥檙e using Java runtime?