Exception when to create request via aws lambda invoke
See original GitHub issue- Framework version: XX
- Implementations: Jersey / Spring / Spring Boot / Spark
Scenario
Using
aws lambda invoke
–invocation-type RequestResponse
–function-name SomeFunction
–region us-east-1
–payload file://file-path/input.txt
–profile adminuser
outputfile.txt
Expected behavior
Mapping the request which is NOT from API gateway proxy mode to Spring Request
Actual behavior
Exception
Steps to reproduce
Full log output
com.amazonaws.serverless.proxy.internal.LambdaContainerHandler
stack_trace : "com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of `java.lang.String` out of START_OBJECT token^@
at [Source: (lambdainternal.util.NativeMemoryAsInputStream); line: 1, column: 1412] (through reference chain: com.amazonaws.serverless.proxy.model.AwsProxyRequest[\"body\"])^@
\tat com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)^@
\tat com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1342)^@
\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)^@
\tat com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)^@
\tat com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:63)^@
\tat com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)^@
\tat com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeAndSet(MethodProperty.java:127)^@
\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.vanillaDeserialize(BeanDeserializer.java:288)^@
\tat com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:151)^@
\tat com.fasterxml.jackson.databind.ObjectReader._bindAndClose(ObjectReader.java:1611)^@
\tat com.fasterxml.jackson.databind.ObjectReader.readValue(ObjectReader.java:1188)^@
\tat com.amazonaws.serverless.proxy.internal.LambdaContainerHandler.proxyStream(LambdaContainerHandler.java:199)^@
\tat com.demo.StreamLambdaHandler.handleRequest(StreamLambdaHandler.java:46)^@
\tat sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)^@
\tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)^@
\tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)^@
\tat java.lang.reflect.Method.invoke(Method.java:498)^@
\tat lambdainternal.EventHandlerLoader$StreamMethodRequestHandler.handleRequest(EventHandlerLoader.java:350)^@
\tat lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888)^@
\tat lambdainternal.AWSLambda.startRuntime(AWSLambda.java:283)^@
\tat lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64)^@
\tat java.lang.Class.forName0(Native Method)^@
\tat java.lang.Class.forName(Class.java:348)^@
\tat lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)^@
Issue Analytics
- State:
- Created 5 years ago
- Comments:14
Top Results From Across the Web
Invoke - AWS Lambda - AWS Documentation
Invokes a Lambda function. You can invoke a function synchronously (and wait for the response), or asynchronously. To invoke a function asynchronously, set...
Read more >AWS Lambda function errors in Java
This page describes how to view Lambda function invocation errors for the Java runtime using the Lambda console and the AWS CLI.
Read more >Error handling and automatic retries in AWS Lambda
When you invoke a function, two types of error can occur. Invocation errors occur when the invocation request is rejected before your function...
Read more >AWS Lambda function errors in C# - AWS Lambda
This page describes how to view Lambda function invocation errors for the C# runtime using the Lambda console and the AWS CLI.
Read more >Troubleshoot invocation issues in Lambda
When you invoke a Lambda function, Lambda validates the request and checks for scaling capacity before sending the event to your function or, ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
No, it only supports specific types. I envision you doing something like this (using Jersey as an example):
Resolving this since we have also created the wiki guide.