I get this error when running my AWS Lambda No response from invoke container for Function
. I would expect it to return the "hello world" String that I defined as output:
I also tried it with this simplier Lambda function, but I get the same error:
public class App implements RequestHandler<String, String> {
public String handleRequest(final String input, final Context context) {
return "H";
}
}
I started Docker locally to run this Lambda with the Docker Quickstart Terminal:
Do I maybe need to do anything else in Docker?
This is how I created the new AWS Lambda project with the IntelliJ Plugin AWS Toolkit:
and selected following settings:
Invalidate Caches and Restart
:Then the project loads properly, but I don't get that Lambda symbol next to my App class:
Import as Maven project
. This works and I see the Lambda symbol now:But I get a new Error in the AppTest class, and when I try to run it, it says can't find the app handler.
5. I resolved this by changing APIGatewayProxyRequestEvent
in the RequestHandler
to 'Object':
I have never tried to build and execute a Lambda function in the manner that you described. Personally, I use IntelliJ and the Java Lambda runtime API to build a Lambda function and then use Maven to package it up and deploy it by using the AWS Management Console at:
https://console.aws.amazon.com/lambda/home
You can test it from the console and see the output in Cloudwatch logs. This works without issues. For more information about how to package a Lambda function using Maven and deploy it using the AWS Management Console, see this AWS Tutorial:
If you built your example Lambda function in the manner specified in this tutorial, you will have no issues:
public class App implements RequestHandler<String, String> {
public String handleRequest(final String input, final Context context) {
return "H";
}
}