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

CloudEvent deserialization does not work with quarkus-resteasy-reactive #27970

Closed
wojciechkopciewicz opened this issue Sep 15, 2022 · 8 comments · Fixed by #27981
Closed

CloudEvent deserialization does not work with quarkus-resteasy-reactive #27970

wojciechkopciewicz opened this issue Sep 15, 2022 · 8 comments · Fixed by #27981
Assignees
Labels
area/resteasy-reactive kind/bug Something isn't working
Milestone

Comments

@wojciechkopciewicz
Copy link

wojciechkopciewicz commented Sep 15, 2022

Describe the bug

When using quarkus-resteasy-reactive (plus quarkus-resteasy-reactive-jackson) CloudEvent class cannot be deserialized on REST endpoints. Everything works fine with quarkus-reasteasy.

Expected behavior

CloudEvent class should be deserialized.

Actual behavior

The following exception is being thrown and 500 Internal Server Error is returned from the server:

ERROR [io.qua.res.rea.jac.run.map.NativeInvalidDefinitionExceptionMapper] (vert.x-eventloop-thread-0) com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `io.cloudevents.CloudEvent` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information
 at [Source: (ByteArrayInputStream); line: 1, column: 1]

How to Reproduce?

cloudevents-reactive-sample.zip

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.12.2.Final

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@wojciechkopciewicz wojciechkopciewicz added the kind/bug Something isn't working label Sep 15, 2022
@quarkus-bot
Copy link

quarkus-bot bot commented Sep 15, 2022

/cc @FroMage, @geoand, @stuartwdouglas

@geoand
Copy link
Contributor

geoand commented Sep 15, 2022

I'll have a look later on today or tomorrow

@geoand
Copy link
Contributor

geoand commented Sep 15, 2022

It seems to work in Classic RESTEasy because of an undocumented feature there: The extension code scans the classpath for JAX-RS Providers. I am a little weary of adding the same feature to RESTEasy Reactive.

I propose adding the Jandex plugin to the build of io.cloudevents:cloudevents-http-restful-ws.

@wojciechkopciewicz
Copy link
Author

@geoand would you be able to provide a working example?

@geoand
Copy link
Contributor

geoand commented Sep 16, 2022

I'm actually rethinking this and it probably does make sense to do what RESTEasy Classic does

@geoand
Copy link
Contributor

geoand commented Sep 16, 2022

#27981 should take care of the issue

@wojciechkopciewicz
Copy link
Author

In the meantime I tried to use jandex option using application.properties approach described here: https://quarkus.io/guides/cdi-reference#how-to-generate-a-jandex-index and it works fine.

@geoand
Copy link
Contributor

geoand commented Sep 16, 2022

Yeah, that's the general way to index libraries on the classpath that are not searched by default

geoand added a commit to geoand/quarkus that referenced this issue Sep 16, 2022
@geoand geoand self-assigned this Sep 16, 2022
geoand added a commit to geoand/quarkus that referenced this issue Sep 16, 2022
geoand added a commit to geoand/quarkus that referenced this issue Sep 16, 2022
geoand added a commit that referenced this issue Sep 16, 2022
Detect MessageBodyReader/Writer from META-INF/services/javax.ws.rs.ext.Providers
@quarkus-bot quarkus-bot bot added this to the 2.14 - main milestone Sep 16, 2022
@gsmet gsmet modified the milestones: 2.14 - main, 2.13.0.Final Sep 20, 2022
gsmet pushed a commit to gsmet/quarkus that referenced this issue Sep 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-reactive kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants