Skip to content

Inconsistent behavior on unrecognized path (404 with empty body OR 404 with RESTEASY003210) #12256

Open
@moyshe

Description

Describe the bug
Depending on the way my quarkus application is started, it behaves differently when I try to reach unmatched path.

Expected behavior
When the resource is unavaliable (there's no matching method) the app returns 404 with empty body. It happens like that when I run it in quarkus:dev mode and run the request from Postman. When I run it from browser I recive a list of available endpoints, which is also ok.

Actual behavior
When I run the same project from a jar file I receive 404 with text/html content saying "RESTEASY003210: Could not find resource for full path: http://localhost:8080/test". The same happens when I try to reach the endpoint via the browser.

To Reproduce

  1. Generate and download a project from https://code.quarkus.io/ (with RESTEasy JAX-RS included)
  2. Run the project with mvn clean quarkus:dev and see proper response while calling unmatched resource http://localhost:8080/test (404 with empty body) from Postman
  3. Run the project from jar (mvn clean package & java -jar ./target/code-with-quarkus-1.0.0-SNAPSHOT-runner.jar) and see different behavior while calling unmatched resource http://localhost:8080/test (404 with text/html response body) from both Postman and the browser.

Environment (please complete the following information):

  • uname -a
Darwin MBP-Hubert.localdomain 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64
  • java -version
openjdk version "11.0.5" 2019-10-15
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.5+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.5+10, mixed mode)
  • Quarkus version: 1.8.1.Final (but behavior is the same on previous versions as well)
  • mvn --version
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /Users/hlewand/Tools/apache-maven-3.6.3
Java version: 11.0.5, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.6", arch: "x86_64", family: "mac"

Additional context

  • I once ended up in a situation where for every unmatched resource I received HTTP 204 response, but I don't know how to reproduce it.
  • I am aware that I can provide ContainerResponseFilter that will remove the body from HTTP 404 response, but that's not the point. I'd like to let you know about the inconsistency in behavior and hope that you will provide a way to unify it.

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions