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 - Interfaces are added as a Bean causing jakarta.enterprise.inject.AmbiguousResolutionException #34657

Closed
floresmleonardo opened this issue Jul 10, 2023 · 4 comments · Fixed by #34888
Labels
area/rest kind/bug Something isn't working
Milestone

Comments

@floresmleonardo
Copy link

Describe the bug

When utilizing RESTeasy Reactive, an issue arises when multiple classes implement the same interface and, the interface has methods with the @path annotation. In this scenario, Quarkus mistakenly registers the interface as a bean, which results in a jakarta.enterprise.inject.AmbiguousResolutionException due to the presence of multiple beans without a qualifier.

Note: This issue occurs specifically in the context of RESTeasy Reactive with Quarkus. If you change to RESTeasy Classic, then, it behaves as expected.

Expected behavior

Quarkus should handle the usage of the interface correctly and avoid registering it as a bean to prevent the jakarta.enterprise.inject.AmbiguousResolutionException.

Actual behavior

Quarkus mistakenly treats the interface as a bean, leading to the jakarta.enterprise.inject.AmbiguousResolutionException error.

How to Reproduce?

Repo: https://github.com/floresmleonardo/quarkus-bug-resteasy-reactive

Run the application

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

3.2.0

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

No response

Additional information

No response

@floresmleonardo floresmleonardo added the kind/bug Something isn't working label Jul 10, 2023
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 10, 2023

/cc @FroMage (resteasy-reactive), @Sgitario (resteasy-reactive), @geoand (resteasy-reactive), @stuartwdouglas (resteasy-reactive)

@geoand
Copy link
Contributor

geoand commented Jul 11, 2023

Looks like a bug indeed but I fear that addressing this will cause other issues.

In any case, it needs some investigation.

@diogocarleto
Copy link
Contributor

diogocarleto commented Jul 18, 2023

Hi guys, same thing here, I'm trying to migrate to resteasy reactive and the same happens, if I comment the @Path and @GET/@POST it works. I'm using the 2.16.8.Final version.

geoand added a commit to geoand/quarkus that referenced this issue Jul 20, 2023
We don't want to create subresources for interfaces
that are used by multiple resource classes
for the purpose of reusing resource methods
and JAX-RS annotations

Fixes: quarkusio#34657
@geoand
Copy link
Contributor

geoand commented Jul 20, 2023

#34888 fixes the issue

geoand added a commit that referenced this issue Jul 20, 2023
Make subresource handling for interfaces more nuanced
@quarkus-bot quarkus-bot bot added this to the 3.3 - main milestone Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants