-
Notifications
You must be signed in to change notification settings - Fork 560
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LambdaContainerHandler - Error while mapping object to RequestType class #494
Comments
Can you please increase the log level for Jackson so we get more details? |
Tried with different settings but could not increase it more than it is. This time response was 200, but was empty:
|
Hmm there may be multiple reasons, hard for me to reproduce with the information given. Would it possible for you to share a repo with a project that I can just deploy to narrow it down? |
To help us debug your issue fill in the basic information below using the options provided
Serverless Java Container version:
1.9
Implementations:
Spring Boot 2
Framework version:
SpringBoot 2.7.6.RELEASE
Frontend service:
REST API
Deployment method:
Console
Scenario
Describe what you are trying to accomplish
I have created an AP Gateway REST API which proxies to a Springboot Java application exposing differnet endpoints, mostly returning Monos and Fluxes. Payload inputted is below.
{ "resource": "/{proxy+}", "path": "/capitals", "httpMethod": "GET", "headers": { "Accept": "application/json", "Accept-Encoding": "gzip, deflate", "Cache-Control": "no-cache", "Content-Type": "application/json", "Host": "xxxxxxx.execute-api.eu-north-1.amazonaws.com", "Postman-Token": "zzzzzzz-4c21-4a6b-a71a-b5d39ce42332", "User-Agent": "PostmanRuntime/7.28.4", "X-Amzn-Trace-Id": "Root=1-638f4d15-626c445233b14ceb2f567363", "X-BlueCoat-Via": "0drrr83fc54be448", "X-Forwarded-For": "1.2.3.4", "X-Forwarded-Port": "443", "X-Forwarded-Proto": "https" }, "multiValueHeaders": { "Accept": [ "application/json" ], "Accept-Encoding": [ "gzip, deflate" ], "Cache-Control": [ "no-cache" ], "Content-Type": [ "application/json" ], "Host": [ "ay9vitrep4.execute-api.eu-north-1.amazonaws.com" ], "Postman-Token": [ "zzzzzzz-4c21-4a6b-a71a-b5d39ce42332" ], "User-Agent": [ "PostmanRuntime/7.28.4" ], "X-Amzn-Trace-Id": [ "Root=1-638f4d15-626c445233b14ceb2f567363" ], "X-BlueCoat-Via": [ "ggg3fc54be448" ], "X-Forwarded-For": [ "1.2.3.4" ], "X-Forwarded-Port": [ "443" ], "X-Forwarded-Proto": [ "https" ] }, "queryStringParameters": null, "multiValueQueryStringParameters": null, "pathParameters": { "proxy": "capitals" }, "stageVariables": null, "requestContext": { "resourceId": "sm5w9j", "resourcePath": "/{proxy+}", "httpMethod": "GET", "extendedRequestId": "cuj7cEsTgi0FkCA=", "requestTime": "06/Dec/2022:14:09:25 +0000", "path": "/dev/capitals", "accountId": "123456789", "protocol": "HTTP/1.1", "stage": "dev", "domainPrefix": "ay9vitrep4", "requestTimeEpoch": 1670335765833, "requestId": "50facc59-b889-44a0-8a58-f86431bf0897", "identity": { "cognitoIdentityPoolId": null, "accountId": null, "cognitoIdentityId": null, "caller": null, "sourceIp": "1.2.3.4", "principalOrgId": null, "accessKey": null, "cognitoAuthenticationType": null, "cognitoAuthenticationProvider": null, "userArn": null, "userAgent": "PostmanRuntime/7.28.4", "user": null }, "domainName": "xxxxxxxxx.execute-api.eu-north-1.amazonaws.com", "apiId": "xxxxxxxx" }, "body": null, "isBase64Encoded": false }
Nevertheless, when executing the endpoint, the call fails as seems that above payload cannot be mapped into a RequestType class (which is an AWSProxyRequest)
[main] ERROR com.amazonaws.serverless.proxy.internal.LambdaContainerHandler - Error while mapping object to RequestType class
| 2022-12-06T15:38:16.811+01:00 | com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
Expected behavior
Describe how you would expect the application to behave
Json Payload should be returned with 200 response
Actual behavior
Describe what you are seeing instead
Response returns 502 with this error inCloudwatch:
[main] ERROR com.amazonaws.serverless.proxy.internal.LambdaContainerHandler - Error while mapping object to RequestType class | 2022-12-06T15:38:16.811+01:00 | com.fasterxml.jackson.databind.exc.MismatchedInputException: No content to map due to end-of-input
Steps to reproduce
Provide code samples we can use to reproduce the issue as part of our integration tests. If there is a public repository for the misbehaving application link to it here
2)Added LambdaHandler as below
3)Add typical Application (annotated with @SpringBootpplication) + a RestController with this class:
Service class:
The text was updated successfully, but these errors were encountered: