Conversation
…t regardless of declared JAX-RS applications
…t root and with multiple applications The test with an application at the context root fails: the application is deployed, but the health endpoint is not available.
Contributor
|
@jungm I pushed cc6f875 with two more cases for
So the additional container application at An idea would be to add the Two more things I noticed, but did not verify:
|
…he context root CXF runs one server per address, so a separate container application at the context root clashes with an application mapped to /. The container resources are deployed with that application instead. They are passed to the listener next to the application, so the application instance stays as it is and its name bindings don't apply to them.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes TOMEE-4716: with the MicroProfile distribution, a webapp that declares a JAX-RS
Applicationlisting its classes has no/health,/health/live,/health/readyor/health/started(all 404); anApplicationlisting nothing gets them under its own path, e.g./api/health.MicroProfileHealthChecksEndpointonly reached a webapp through class scanning (WebAppInfo.restClass), andRESTServiceonly deploys scanned classes into the default application (noApplicationdeclared) or into anApplicationthat lists nothing. Since TOMEE-3729 a declaredApplicationdeploys exactly the classes it lists, so the endpoint went with the rest of the scanned classes. MicroProfile Health 4.0.1 describes the endpoints as representing the entire runtime, not one JAX-RS application.TomEEMicroProfileListenernow registers the endpoint in a newWebAppInfo.containerRestClassset, andRESTServicedeploys those classes at the context root: as their own internal application when the webapp declaresApplicationsubclasses, as part of the default application otherwise, and in the per-class fallback deployment. CXF runs one server per address, so an application mapped to the context root gets them instead of a separate internal application.RsHttpListener.deployApplicationtakes them next to the application, so the application instance stays as it is and its name bindings don't apply to them. TOMEE-3729's rule is unchanged, and the existing removal of the endpoint when a servlet is mapped to/*still applies.New
HealthEndpointTestintomee-microprofile-itestscovers an@ApplicationPath("/api")application listing its resource and listing nothing (both 404 on/test/healthwithout the fix), applications at/listing their resource, listing nothing and declaring a name binding, and two applications. The rest oftomee-microprofile-itests,itests/jaxrs,openejb-cxf-rs(115 tests) and the MicroProfile Health TCK (28 tests) pass.