I have a simple Lambda function that I'm trying to deploy through Jenkins -
public String handleRequest(String input, Context context) {
String output = "";
if (input.isEmpty()) {
output = "No input provided";
} else {
output = "Hello, " + input + "! Checking invocation - 1";
}
return output;
}
I'm able to deploy and invoke this through Eclipse's AWS Lambda plugin without any problems.
I'm using the AWS Lambda plugin for Jenkins and following their documentation.
- I'm providing my Git repository as the source.
- Artifact Location -
src/main/java/
- Handler Name -
lambda.Hello
(lambda is the package name and Hello is the class name). I've also tried usinglambda.Hello.handleRequest
,lambda.Hello::handleRequest
and other variations.
Jenkins says that the build was successful but when I test it on the AWS console, I'm getting -
"errorMessage": "Class not found: lambda.Hello",
"errorType": "class java.lang.ClassNotFoundException"
Where am I going wrong here? When I export the test function from AWS and unzip it, I can see that code on Git definitely got deployed but it's unable find the class.