holy-lambda

Volodymyr Vizovskyy 2022-04-25T16:09:11.209529Z

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?

Volodymyr Vizovskyy 2022-04-26T07:46:44.132299Z

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 馃槄

Karol W贸jcik 2022-04-26T07:50:37.281259Z

But the dynamically compiled binaries are run via sam local invoke, so it should work even on NIX.

Volodymyr Vizovskyy 2022-04-26T07:50:52.145469Z

In fact, it does 馃檪

Volodymyr Vizovskyy 2022-04-26T07:50:54.094439Z

thanks again!

Karol W贸jcik 2022-04-26T07:51:51.283689Z

Yeah. Dockerfile is only for Java. Anyway I鈥檓 revamping the layers support so soon it should be much easier to use HL with Java.

馃檶 1
Karol W贸jcik 2022-04-25T19:21:23.111049Z

Yeah. You cannot run the lambda from jar. The reason for this is your environment is not AWS Lambda Runtime.

Karol W贸jcik 2022-04-25T19:22:33.663619Z

You can either emulate the runtime via sam local or deploy the lambda on real environment.

Karol W贸jcik 2022-04-25T19:49:17.280879Z

Btw, why do you create a native artifact if you鈥檙e using Java runtime?