localstack-java-utils icon indicating copy to clipboard operation
localstack-java-utils copied to clipboard

ERROR: java.util.LinkedHashMap cannot be cast to APIGatewayProxyRequestEvent

Open fuzzy28 opened this issue 4 years ago • 1 comments
trafficstars

Is there an existing issue for this?

  • [x] I have searched the existing issues

Current Behavior

Unfortunately, the issue exists in the current docker build

localstack.services.awslambda.lambda_executors.InvocationException: Lambda process returned error status code: 1. Result: . Output:
Exception in thread "main" java.lang.ClassCastException: class java.util.LinkedHashMap cannot be cast to class com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent (java.util.LinkedHashMap is in module java.base of loader 'bootstrap'; com.amazonaws.services.lambda.runtime.events.APIGatewayProxyRequestEvent is in unnamed module of loader 'app')
        at com.fitness.society.users.handlers.UserRegistrationAPIGatewayHandler.handleRequest(UserRegistrationAPIGatewayHandler.java:26)
        at cloud.localstack.LambdaExecutor.main(LambdaExecutor.java:119)

Expected Behavior

Should work with the below dependency as it was closed and verified in the original ticket https://github.com/localstack/localstack/issues/1634

   <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-lambda-java-events</artifactId>
        <version>2.0.2</version>
    </dependency>

How are you starting LocalStack?

With a docker run command

Steps To Reproduce

How are you starting localstack (e.g., bin/localstack command, arguments, or docker-compose.yml)

docker run localstack/localstack

Client commands (e.g., AWS SDK code snippet, or sequence of "awslocal" commands)

curl -X POST http://192.168.1.1:4566/restapis/mvy1yew0wa/prod/_user_request_/users

Environment

- OS: Amazon Linux2
- LocalStack: localstack/localstack   latest    087de49bf85a

Anything else?

No response

fuzzy28 avatar Oct 28 '21 11:10 fuzzy28

Hi! We just wanted to follow up to see whether your issue has been resolved. Were you able to get it working with the latest version of LocalStack? We would appreciate your feedback!

lakkeger avatar Nov 14 '23 08:11 lakkeger