Running AWS Lambda with Java in IntelliJ locally – No response from invoke container for Function (Problem with Docker?)

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:

the error

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:

my 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:

  1. File -> New Project:

new project

and selected following settings:

settings

  1. The created project had a lot of errors, (Cannot resolve symbol ‘String’ etc.). I was able to resolve the errors by deleting the .idea folder, then click on File -> Invalidate Caches and Restart:

errors

Then the project loads properly, but I don’t get that Lambda symbol next to my App class:

missing Lambda symbol

  1. So I go to pom.xml, right click and then Import as Maven project. This works and I see the Lambda symbol now:

with Lambda Symbol

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’:

resolved error

enter image description here

Source: Docker Questions

LEAVE A COMMENT