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 Classic - annotation on abstract jakarta.ws.rs.core.Application class is not ignored #42963

Closed
rsvoboda opened this issue Sep 2, 2024 · 8 comments · Fixed by #44195
Labels
area/resteasy-classic kind/bug Something isn't working
Milestone

Comments

@rsvoboda
Copy link
Member

rsvoboda commented Sep 2, 2024

Describe the bug

RESTEasy Classic - annotation on abstract jakarta.ws.rs.core.Application class is not ignored

#41465 should ensure abstract jakarta.ws.rs.core.Application classes are ignored

But it's not the case when I put @ApplicationPath on it. Path gets unfortunately reflected.
E.g. endpoint is available on http://localhost:8080/rest/hello instead of http://localhost:8080/hello.

Expected behavior

Annotation on abstract jakarta.ws.rs.core.Application class is ignored

Actual behavior

annotation on abstract jakarta.ws.rs.core.Application class is NOT ignored

How to Reproduce?

package org.acme;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/rest")
public abstract class AbstractApplication extends Application {
}

Output of uname -a or ver

macOS

Output of java -version

Java 21

Quarkus version or git rev

Quarkus 3.14.1

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

No response

Additional information

No response

@gsmet
Copy link
Member

gsmet commented Sep 3, 2024

I don't think it has anything to do with Quarkus. I also am not sure it's a bug.

You would have to check the spec and if it had to be changed, I would expect the change to be in RESTEasy itself?

@rsvoboda
Copy link
Member Author

rsvoboda commented Sep 3, 2024

@geoand did https://github.com/quarkusio/quarkus/pull/41465/files to ignore abstract jakarta.ws.rs.core.Application classes. So that's why I assume annotation on such abstract classes should not make any impact to the app.

Quarkus REST ignores @ApplicationPath in the same use-cese.

@jamezp what's your view on this?

@jamezp
Copy link
Contributor

jamezp commented Sep 3, 2024

The annotation is not set as @Inherited. I don't really know how Quarkus scans for types though. Does Quarkus do it's own scanning for applications? I know that's how it works in WildFly, the deployment is scanned for Applications there. RESTEasy doesn't actually scan for the Application.

@geoand
Copy link
Contributor

geoand commented Sep 3, 2024

Same for Quarkus

@jamezp
Copy link
Contributor

jamezp commented Sep 3, 2024

Cool, kind of what I assumed :) So it's likely somewhere in Quarkus it needs to be fixed then.

@geoand
Copy link
Contributor

geoand commented Oct 30, 2024

Okay, no I see what the problem is.

@jamezp just to clarify, on WildFly if a class like

package org.acme;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

@ApplicationPath("/rest")
public abstract class AbstractApplication extends Application {
}

exists, then @ApplicationPath("/rest") will be completely ignored, correct?

@geoand
Copy link
Contributor

geoand commented Oct 30, 2024

#44195 is what I have in mind

@jamezp
Copy link
Contributor

jamezp commented Oct 30, 2024

@geoand Correct. Any abstract classes are simply ignored. TBH I can't think of a use-case for an abstract application class though.

geoand added a commit that referenced this issue Oct 31, 2024
Properly handle `@ApplicationPath` and `Application` in RESTEasy Classic
@quarkus-bot quarkus-bot bot added this to the 3.17 - main milestone Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/resteasy-classic kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants