I’m trying to make my SpringBoot 3.3 application run as an AWS Lambda Function. However, I’m encountering the following error:
{
"errorMessage": "Class not found: org.xyz.service.api.http.xxx.AwsLambdaHandler",
"errorType": "java.lang.ClassNotFoundException"
}
Upon inspecting the JAR file, I found that it is packaged as BOOT-INF/classes/org/xyz/service/api/http/xxx/AwsLambdaHandler.class.
Here are some details about my setup:
I'm using Maven to build the JAR.
The runtime specified for the Lambda function is Java 21.
The handler is set to org.xyz.service.api.http.xxx.AwsLambdaHandler::handleRequest.
My pom.xml includes the necessary dependencies and plugins to build the SpringBoot application.
Things I've Tried:
Verified the class path inside the JAR.
Ensured the handler class and method are correct.
What could be causing the java.lang.ClassNotFoundException for the entry class? Do I need to change the handler class or modify the way the JAR is built?
Any help or pointers would be greatly appreciated!