[GraalVM] Jackson serialisation test gives false positive for AWS Lambda #41350
Labels
area/amazon-lambda
area/jackson
Issues related to Jackson (JSON library)
area/kotlin
area/native-image
kind/bug
Something isn't working
triage/invalid
This doesn't seem right
Describe the bug
Hello everyone.
I would like to report unexpected behaviour when running my quarkus native lambda on AWS and how testing in native mode gives me probably false positive results (not sure at this point if it is issue on GraalVM side which I use for native compilation or AWS environment and how I run my lambda there).
Expected behavior
When you check provided reproducer you will see:
Lambda class LambdaEndToEnd test class.
In Lambda.class here is handleRequest function which looks like that:
This method is supposed to use ObjectMapper (no custom configuration provided, all default) to serialize given value.
The result should be json format [{"data":"Data"}]
Actual behavior
Unfortunately when I run my lambda on AWS then serializedValue is always [{}], unless I annotate TestData.class (which is being serialized) with @RegisterForReflection (from io.quarkus.runtime.annotations) whereas it is not required whenever I run test either with JVM or natively using GraalVM.
So in nutshell, outside of AWS environment (basic config info below) serialisation doesn't work as expected but when JVM or GraalVM is used then everything is fine (even without @RegisterForReflection set anywhere).
I do not understand where is the issue located. Is it unexpected "native" behaviour when testing serialisation with GraalVM or there is something wrong on AWS side?
How to Reproduce?
Below two screenshots from AWS:
This one shows result from CloudWatch logs when lambda is run
This shows lambda configuration
Output of
java -version
OpenJDK Runtime Environment Corretto-17.0.9.8.1 (build 17.0.9+8-LTS)
Mandrel or GraalVM version (if different from Java)
GraalVM version 21.0.1
Quarkus version or git rev
3.10.1
Build tool (ie. output of
mvnw --version
orgradlew --version
)Gradle 8.5
Additional information
Kotlin: 1.9.20
Groovy: 3.0.17
Ant: Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM: 17.0.9 (Amazon.com Inc. 17.0.9+8-LTS)
OS: Mac OS X 13.5 aarch64
The text was updated successfully, but these errors were encountered: