Markus Jung created TOMEE-4643:
----------------------------------
Summary: REST 3.1: no META-INF/services discovery for
Feature/DynamicFeature; superclass @Path returns 405 not 404
Key: TOMEE-4643
URL: https://issues.apache.org/jira/browse/TOMEE-4643
Project: TomEE
Issue Type: Bug
Reporter: Markus Jung
h2. Summary
REST 3.1 {{META-INF/services}} discovery of {{Feature}}/{{DynamicFeature}} is
missing, and a request that only matches a superclass {{@Path}} returns 405
instead of the required 404.
h2. Description
TomEE does not scan {{META-INF/services}} for {{Feature}} and
{{DynamicFeature}} implementations. The REST 3.1 spec asks the runtime to pick
these up through the standard Java {{ServiceLoader}} mechanism at deploy time.
Because TomEE (through CXF) skips this step, a {{Feature}} or
{{DynamicFeature}} packaged this way never registers, and any behavior it
should add to the request or response pipeline never runs.
Related upstream tracking: CXF-9005.
Second, when a request path matches a method only declared on a superclass
through {{@Path}}, and not on the subclass that serves the resource, TomEE
answers with HTTP 405 (Method Not Allowed). The spec requires 404 (Not Found)
in this case, since the subclass does not expose a matching resource method at
that path. TomEE's path-matching logic treats the superclass mapping as present
but the method as wrong, when it should treat the path itself as absent for the
subclass.
Both gaps sit in TomEE's JAX-RS/CXF integration, not in the TCK or the test
harness.
Related to TOMEE-4321, the open umbrella ticket for JAX-RS TCK failures — this
issue reports two specific, well-defined gaps under that umbrella.
h2. Steps to reproduce / TCK reference
Suite: Jakarta RESTful Web Services 4.0 TCK
({{jakarta.ws.rs:jakarta-restful-ws-tck:4.0.1}}).
Feature/DynamicFeature discovery:
*
{{ee/jakarta/tck/ws/rs/jaxrs31/spec/extensions/JAXRSClientIT.java#featureIsRegisteredTest}}
*
{{ee/jakarta/tck/ws/rs/jaxrs31/spec/extensions/JAXRSClientIT.java#dynamicFeatureIsRegisteredTest}}
Superclass {{@Path}} matching (405 vs 404):
*
{{ee/jakarta/tck/ws/rs/spec/resource/annotationprecedence/subclass/JAXRSClientIT.java#incorrectPathOnClassTest}}
All three are excluded in {{runner-standalone/exclusions/rest.txt}} in the
apache/tomee-tck harness repo. Remove the matching lines once fixed, and the
suite should pass those tests without the exclusion.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)