Quarkus 1.12.1.Final doesnt honor the path declared in the javax.ws.rs.core.Application
See original GitHub issueDescribe the bug
I chose to implement a javax.ws.rs.core.Application because of some OpenAPI values I would like define there (info, security and so on). I defined the base path of my application inside the javax.ws.rs.core.Application class, with the Path() annotation.
Quarkus ignores the declared path. The resources still work with their declared path without the prefix path declared inside the javax.ws.rs.core.Application class.
Following an example:
- javax.ws.rs.core.Application class with Path(“/application”)
- resource with Path(“/resource”)
I can successfully call the rest resource with the path /resource, but it doesnt work with the path /application/resource.
Expected behavior I should be able to successfully call the /application/resource endpoint.
Actual behavior I can successfully call the rest resource with the path /resource, but it doesnt work with the path /application/resource.
To Reproduce
Link to a small reproducer (preferably a Maven project if the issue is not Gradle-specific).
https://github.com/dbl81/applicationpath.git
Steps to reproduce the behavior:
- clone the repo
- mvn compile quarkus:dev
- browse: http://localhost:8080/application/resource --> 404
- browse: http://localhost:8080/resource --> 200 (plain text response “hello”)
Configuration
Screenshots
Environment (please complete the following information):
- Output of
uname -a
orver
: Windows 10 Home Edition - Output of
java -version
:
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.7+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.7+10, mixed mode)
- Quarkus version or git rev: 1.12.1.Final
- Build tool (ie. output of
mvnw --version
orgradlew --version
): mvn
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: C:\Program Files\apache-maven-3.6.3
Java version: 11.0.7, vendor: AdoptOpenJDK, runtime: C:\Program Files\jdk-11.0.7.10-hotspot
Default locale: it_IT, platform encoding: Cp1252
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"
Additional context
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)
OMG, shame on me! I’m really sorry for bothering! I followed your hint and it worked like a charm.
Hoping next time I can help you in improving the cool Quarkus. I close this issue.
I was using resteasy (not the reactive implementation), I’m sorry I didnt mention it before! I ran my previous test on resteasy (not reactive) and the example I published (branch called main) has resteasy as dependency.
Following your (inverse) input I switched to resteasy-reactive and I faced the same problems. I pushed the new code to the branch called reactive.