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

RESTEASY002160 warning when starting an application with @RegisterRestClient #17627

Closed
vsevel opened this issue Jun 2, 2021 · 6 comments · Fixed by #17656
Closed

RESTEASY002160 warning when starting an application with @RegisterRestClient #17627

vsevel opened this issue Jun 2, 2021 · 6 comments · Fixed by #17656
Assignees
Labels
area/rest-client kind/bug Something isn't working
Milestone

Comments

@vsevel
Copy link
Contributor

vsevel commented Jun 2, 2021

Describe the bug

Developing an application with a @RegisterRestClient prints out the following warning:

2021-06-02 13:52:24,412 WARN  [org.jbo.res.res.i18n] (executor-thread-0) RESTEASY002160: Provider instance org.jboss.resteasy.microprofile.client.publisher.MpPublisherMessageBodyReader is already registered.  2nd registration is being ignored.

Expected behavior

No warning.

Actual behavior

Warning printed out.

To Reproduce

You will see the warning.

Configuration

as documented in the guide.

Quarkus version or git rev

2.0.0.CR2

@vsevel vsevel added the kind/bug Something isn't working label Jun 2, 2021
@geoand
Copy link
Contributor

geoand commented Jun 2, 2021

I will take a look

@quarkus-bot
Copy link

quarkus-bot bot commented Jun 2, 2021

/cc @michalszynkiewicz

@geoand
Copy link
Contributor

geoand commented Jun 2, 2021

@radcortez it seems like QuarkusRestClientBuilder which you added for supporting MP 4 is registering MpPublisherMessageBodyReader, but that provider is also being picked up (due to the @Provider annotation) in ResteasyCommonProcessor#setupProviders.

I wonder if we should just skip the registration in the latter case when the MP Client capability is present...

@radcortez
Copy link
Member

Is registration automatic? Don't you need a @RegisterProvider in the REST Client case?

@geoand
Copy link
Contributor

geoand commented Jun 2, 2021

It gets registered with RESTEasy because it handles both the server and client providers in the same way.

@radcortez
Copy link
Member

Feel free to remove one of the registrations. The code I added is mostly a copy from RESTEasy and it was the only way to pass in our own custom CDI injector. I guess that I should have also submitted a PR to make that more extendable on the RESTEasy to remove the unnecessary Quarkus code. In that case, I believe we probably need to filter out on the Processor side.

geoand added a commit to geoand/quarkus that referenced this issue Jun 3, 2021
@geoand geoand self-assigned this Jun 3, 2021
geoand added a commit that referenced this issue Jun 3, 2021
Prevent double registration of MpPublisherMessageBodyReader in rest client
@quarkus-bot quarkus-bot bot added this to the 2.1 - main milestone Jun 3, 2021
@gsmet gsmet modified the milestones: 2.1 - main, 2.0.0.CR3 Jun 3, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/rest-client kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants