It should work fine with a FAT JAR or native executable.
Actual Behaviour
With Java it works fine. but with native execuiable it fails:
Fails with:
Caused by: io.micronaut.http.codec.CodecException: Error decoding stream for type [class com.amazonaws.serverless.proxy.model.AwsProxyRequest]: Cannot construct instance of `com.amazonaws.serverless.proxy.model.SingleValueHeaders` (no Creators, like default constructor, exist): no default constructor found
at [Source: (byte[])"{"resource":"/","path":"/","httpMethod":"GET","headers":{"Accept":"*/*","CloudFront-Forwarded-Proto":"https","CloudFront-Is-Desktop-Viewer":"true","CloudFront-Is-Mobile-Viewer":"false","CloudFront-Is-SmartTV-Viewer":"false","CloudFront-Is-Tablet-Viewer":"false","CloudFront-Viewer-ASN":"3352","CloudFront-Viewer-Country":"ES","Host":"644w7xh6r1.execute-api.us-east-1.amazonaws.com","User-Agent":"curl/7.84.0","Via":"2.0 d965728bf3120b9df2983219ebe95680.cloudfront.net (CloudFront)","X-Amz-Cf-Id":"Enl"[truncated 1804 bytes]; line: 1, column: 57] (through reference chain: com.amazonaws.serverless.proxy.model.AwsProxyRequest["headers"])
SingleValueHeader looks like:
package com.amazonaws.serverless.proxy.model;
import java.util.TreeMap;
public class SingleValueHeaders extends TreeMap<String, String> {
private static final long serialVersionUID = 42L;
public SingleValueHeaders() {
super(String.CASE_INSENSITIVE_ORDER);
}
}
run ./test-lambda.sh You will see internal server error in the output instead of success. If you go to your AWS Console and check the cloud watch logs for the Lambda you will see the previous error.
Expected Behavior
Since version 1.9
aws-serverless-java-container
introducedSingleValueHeaders.java
.It should work fine with a FAT JAR or native executable.
Actual Behaviour
With Java it works fine. but with native execuiable it fails:
Fails with:
SingleValueHeader
looks like:Steps To Reproduce
./test-lambda.sh
You will see internal server error in the output instead ofsuccess
. If you go to your AWS Console and check the cloud watch logs for the Lambda you will see the previous error.Environment Information
x86 architecture
Example Application
Sample App
Version
3.8.0-SNAPSHOT