Skip to content

Conversation

@holomekc
Copy link
Contributor

We forgot to register some classes. So native images sometimes fail unexpectedly:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.quarkus.amazon.lambda.runtime.FunctionError and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS). This appears to be a native image, in which case you may need to configure reflection for the class that is to be serialized
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1328)
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:414)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:49)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4811)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:4011)
	at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop.postError(AbstractLambdaPollLoop.java:279)
	at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:154)
	at java.base@21.0.6/java.lang.Thread.runWith(Thread.java:1596)
	at java.base@21.0.6/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)

and here as well. I registered more missing classes as well:

java.lang.IllegalArgumentException: Could not serialize the provided output.
	at io.quarkus.funqy.lambda.event.AwsEventOutputWriter.writeValue(AwsEventOutputWriter.java:31)
	at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop.postResponse(AbstractLambdaPollLoop.java:255)
	at io.quarkus.amazon.lambda.runtime.AbstractLambdaPollLoop$1.run(AbstractLambdaPollLoop.java:143)
	at java.base@21.0.6/java.lang.Thread.runWith(Thread.java:1596)
	at java.base@21.0.6/java.lang.Thread.run(Thread.java:1583)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:896)
	at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:872)
Caused by: com.fasterxml.jackson.databind.exc.InvalidDefinitionException: No serializer found for class io.quarkus.funqy.lambda.model.pipes.Response and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS). This appears to be a native image, in which case you may need to configure reflection for the class that is to be serialized
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1328)
	at com.fasterxml.jackson.databind.DatabindContext.reportBadDefinition(DatabindContext.java:414)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.failForEmpty(UnknownSerializer.java:49)
	at com.fasterxml.jackson.databind.ser.impl.UnknownSerializer.serialize(UnknownSerializer.java:30)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:502)
	at com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:341)
	at com.fasterxml.jackson.databind.ObjectMapper._writeValueAndClose(ObjectMapper.java:4811)
	at com.fasterxml.jackson.databind.ObjectMapper.writeValue(ObjectMapper.java:4011)
	at io.quarkus.funqy.lambda.event.AwsEventOutputWriter.writeValue(AwsEventOutputWriter.java:27)

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 26, 2025

Thanks for your pull request!

Your pull request does not follow our editorial rules. Could you have a look?

  • title should preferably start with an uppercase character (if it makes sense!)
  • title should not start with chore/docs/feat/fix/refactor but be a proper sentence

This message is automatically generated by a bot.

@holomekc holomekc changed the title fix: register classes for reflection Register classes for reflection in amazon lambda and funqy Mar 26, 2025
Copy link
Contributor

@geoand geoand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@geoand geoand added triage/waiting-for-ci Ready to merge when CI successfully finishes triage/backport labels Mar 27, 2025
@quarkus-bot

This comment has been minimized.

@holomekc
Copy link
Contributor Author

I am fixing the formatting. Sorry for that.

@geoand
Copy link
Contributor

geoand commented Mar 27, 2025

No problem!

@quarkus-bot
Copy link

quarkus-bot bot commented Mar 27, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit f34bf3e.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@geoand geoand merged commit 21ab89f into quarkusio:main Mar 27, 2025
25 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.22 - main milestone Mar 27, 2025
@quarkus-bot quarkus-bot bot removed the triage/waiting-for-ci Ready to merge when CI successfully finishes label Mar 27, 2025
@gsmet gsmet modified the milestones: 3.22 - main, 3.21.1 Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants