Skip to content
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

Micronaut AWS Lambda and S3 Event - Guide Example Error #1415

Open
mark-j-68 opened this issue Jan 11, 2024 · 1 comment
Open

Micronaut AWS Lambda and S3 Event - Guide Example Error #1415

mark-j-68 opened this issue Jan 11, 2024 · 1 comment

Comments

@mark-j-68
Copy link

Creating issue as requested in https://stackoverflow.com/questions/77781130/micronaut-aws-lambda-and-s3-event-guide-example-error. Original content copied below;

I downloaded the example project from the "MICRONAUT AWS LAMBDA AND S3 EVENT" guide and followed the instructions to create the Lamdba, the S3 Bucket, and put a Trigger on the S3 bucket.

However, whenever I drop a jpg file into the images folder in the S3 bucket I get this error in Cloudwatch.

An error occurred during JSON parsing: java.lang.RuntimeException
java.lang.RuntimeException: An error occurred during JSON parsing
Caused by: io.micronaut.function.aws.CustomPojoSerializerException: io.micronaut.serde.exceptions.SerdeException: Error decoding property [List records] of type [class com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification]: Cannot invoke "io.micronaut.serde.Deserializer.deserializeNullable(io.micronaut.serde.Decoder, io.micronaut.serde.Deserializer$DecoderContext, io.micronaut.core.type.Argument)" because "this.deserializer" is null
    at io.micronaut.function.aws.JsonMapperCustomPojoSerializer.fromJson(JsonMapperCustomPojoSerializer.java:72)
Caused by: io.micronaut.serde.exceptions.SerdeException: Error decoding property [List records] of type [class com.amazonaws.services.lambda.runtime.events.models.s3.S3EventNotification]: Cannot invoke "io.micronaut.serde.Deserializer.deserializeNullable(io.micronaut.serde.Decoder, io.micronaut.serde.Deserializer$DecoderContext, io.micronaut.core.type.Argument)" because "this.deserializer" is null
    at io.micronaut.serde.support.deserializers.DeserBean$DerProperty.deserializeAndSetConstructorValue(DeserBean.java:857)
    at io.micronaut.serde.support.deserializers.SimpleRecordLikeObjectDeserializer.deserialize(SimpleRecordLikeObjectDeserializer.java:68)
    at io.micronaut.serde.support.deserializers.SimpleRecordLikeObjectDeserializer.deserializeNullable(SimpleRecordLikeObjectDeserializer.java:102)
    at io.micronaut.serde.jackson.JacksonJsonMapper.readValue0(JacksonJsonMapper.java:177)
    at io.micronaut.serde.jackson.JacksonJsonMapper.readValue(JacksonJsonMapper.java:169)
    at io.micronaut.serde.jackson.JacksonJsonMapper.readValue(JacksonJsonMapper.java:206)
    at io.micronaut.function.aws.JsonMapperCustomPojoSerializer.fromJson(JsonMapperCustomPojoSerializer.java:70)
Caused by: java.lang.NullPointerException: Cannot invoke "io.micronaut.serde.Deserializer.deserializeNullable(io.micronaut.serde.Decoder, io.micronaut.serde.Deserializer$DecoderContext, io.micronaut.core.type.Argument)" because "this.deserializer" is null
    at io.micronaut.serde.support.deserializers.DeserBean$DerProperty.deserializeAndSetConstructorValue(DeserBean.java:838)

I had expected it to work as it's the example code from the guide and create thumbnail files.

My JAVA_HOME is set to "/home/mark/.jdks/corretto-17.0.9"

@mark-j-68
Copy link
Author

I only just noticed this - but my issue seems to be a duplicate of #1410.

I attempted similar workarounds with similar results.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant