You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 23, 2023. It is now read-only.
I'm trying to enrich my existing AWS Lambda Java setup with the structured logging functionality. However, I'm failing to get it running with Java 11.
To confirm that it's not something project-specific I forked this sample project and tried to run the helloworld.App on a Java 11 default AWS Lambda runtime and get the following error:
Error loading class helloworld.App: java.lang.ExceptionInInitializerError
java.lang.ExceptionInInitializerError
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Unknown Source)
Caused by: java.lang.UnsupportedOperationException: No class provided, and an appropriate one cannot be found.
at org.apache.logging.log4j.LogManager.callerClass(LogManager.java:573)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:598)
at org.apache.logging.log4j.LogManager.getLogger(LogManager.java:585)
at helloworld.App.<clinit>(App.java:37)
... 2 more
I tried to add this by enriching the transformer setup but still get the same issue when running the sample Lambda of this repo.
What's weird is that this issue seems to only occur on the AWS Lambda runtime. If I manually add the Lambda handler as the Main-Class with a basic main method that invokes the function, and run java -jar target/... I don't see this exception locally.