I want to create a java project with quarkus and want to use GraalVm for ahead of time compilation to lower cold startup times in AWS lambda.
When I deploy it in AWS Lambda and run Test I get the following error:
Class not found: de.timguy.lambda.GreetingLambda: java.lang.ClassNotFoundException
java.lang.ClassNotFoundException: de.timguy.lambda.GreetingLambda. Current classpath: file:/var/task/
Steps I took
-
- Quarkus version: 2.8.2.Final (gradle.properties)
gradlew build -Dquarkus.package.type=native -Dquarkus.native.container-build=true
Version info: GraalVM 22.0.0.2 Java 11 CE 3 user-provided feature(s) - io.quarkus.runner.AutoFeature - io.quarkus.runtime.graal.DisableLoggingAutoFeature - io.quarkus.runtime.graal.ResourcesFeature Produced artifacts: /project/quark2-1.0.0-SNAPSHOT-runner (executable) /project/quark2-1.0.0-SNAPSHOT-runner.build_artifacts.txt Finished generating 'quark2-1.0.0-SNAPSHOT-runner' in 11m 54s. BUILD SUCCESSFUL in 12m 52s
- AWS - create function "quark2"
- runtime "Java 11 Coretto"
- Edit runtime setting: Handler = de.timguy.lambda.GreetingLambda
- Upload quark2/build/runner.zip via S3
- Test -> ClassNotFoundException (see complete error at top)
I choosed the wrong runtime setting:
(Still curios about: