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

Resteasy Reactive: Fix native mode when using Files #26002

Closed
wants to merge 1 commit into from

Conversation

Sgitario
Copy link
Contributor

@Sgitario Sgitario commented Jun 8, 2022

When having the following resource:

@POST
    @Consumes(MediaType.APPLICATION_OCTET_STREAM)
    public String update(File file) {
      // ..
    }

This works fine when running on JVM, but not in Native where fails with a NoSuchMethodException exception.

To fix this issue, I've registered all the resource classes (the ones annotated with @ApplicationPath and @Path) for reflection usage.

In addition to this change:

  • I removed some unused methods and fields from the resteasy reactive processor
  • I added some coverage of the getting started resteasy reactive client (I also reproduced this issue in this test).

Fix #25973

When having the following resource:

```java
@post
    @consumes(MediaType.APPLICATION_OCTET_STREAM)
    public String update(File file) {
      // ..
    }
```

This works fine when running on JVM, but not in Native where fails with a NoSuchMethodException exception.

To fix this issue, I've registered all the resource classes (the ones annotated with `@ApplicationPath` and `@Path`) for reflection usage. 

In addition to this change:
- I removed some unused methods and fields from the resteasy reactive processor
- I added some coverage of the getting started resteasy reactive client (I also reproduced this issue in this test).

Fix quarkusio#25973
}

// Ensure native support of resource endpoints:
reflectiveClass.produce(new ReflectiveClassBuildItem(false, true, false, resourceClass.getClassName()));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@geoand this is the fix I added to solve the linked issue. However, as it works when the resource is not using a File class, I doubt this is the right fix... tho I could not find the right path.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, this is not the fix we want to apply. I will have a closer look later

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I converted this pull request in draft, just to reuse the tests and the clean up.

@gastaldi gastaldi requested a review from geoand June 8, 2022 10:16
@quarkus-bot

This comment has been minimized.

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 9, 2022

Failing Jobs - Building cad1e37

Status Name Step Failures Logs Raw logs
✔️ JVM Tests - JDK 11
JVM Tests - JDK 11 Windows Build ⚠️ Check → Logs Raw logs
✔️ JVM Tests - JDK 17

@geoand
Copy link
Contributor

geoand commented Jun 9, 2022

Closing in favor of #26021.

Thanks for the attempt to tackle the problem @Sgitario!

@geoand geoand closed this Jun 9, 2022
@quarkus-bot quarkus-bot bot added the triage/invalid This doesn't seem right label Jun 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

NoSuchMethodException in Resteasy-reactive when running in native mode
2 participants