TOMEE-4643 - discover Feature/DynamicFeature from META-INF/services - #2877
Open
jungm wants to merge 1 commit into
Open
TOMEE-4643 - discover Feature/DynamicFeature from META-INF/services#2877jungm wants to merge 1 commit into
jungm wants to merge 1 commit into
Conversation
Jakarta REST requires Feature and DynamicFeature implementations declared in META-INF/services to be registered via the JDK ServiceLoader at deploy time. CXF does not implement this lookup itself, relying on the container to hand it already resolved providers, so features packaged this way never registered in TomEE. Scan for both SPIs while assembling the provider list. Service loading is skipped when the Application maps jakarta.ws.rs.loadServices to Boolean.FALSE, as the spec requires, and honours the existing skip-provider-scanning property. Entries are loaded individually so one broken descriptor entry does not discard the remaining providers of that type. Removes the corresponding TCK exclusion, which now passes.
Contributor
|
@jungm Can you check on ee.jakarta.tck.ws.rs.jaxrs21.ee.sse.ssebroadcaster.JAXRSClientIT.sseBroadcastTest ? Is this a regression? |
Member
Author
|
@rzo1 think its flaky but will check |
Member
Author
|
its flaky, sseBroadcastTest starts 5 SSE clients on threads, waits a fixed 2.5s for them to connect, broadcasts 7 messages, then waits only on the first client before asserting all 5 received exactly 8 events. Clients could not be connecting in time or still be processing evens on a crowded machine Also seems to have failed in other runs I did here and there |
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.
Jakarta REST requires
FeatureandDynamicFeatureimplementations declared inMETA-INF/servicesto be registered through the JDKServiceLoaderat deploy time ("Services", Providers / Lifecycle and Environment).CXF does not implement this lookup itself — it relies on the container to hand it already resolved providers, which is why the CXF TCK run stays green on GlassFish. TomEE assembles its provider list on its own, so features packaged this way never registered.
Changes
CxfRsHttpListenerscans both SPIs while assembling the provider list.Applicationmapsjakarta.ws.rs.loadServicestoBoolean.FALSE, as the spec mandates, and the existingcxf.jaxrs.skip-provider-scanningproperty is still honoured.providers(...)path, so the@ConstrainedToand deactivation checks still apply.jaxrs31/spec/extensions/JAXRSClientIT.Testing
ServiceLoaderProviderDiscoveryTest(8 tests) exercises discovery through a throwawayURLClassLoader, so it does not register these features into other tests in the module. Each assertion was confirmed to fail when the corresponding production change is reverted.ee.jakarta.tck.ws.rs.jaxrs31.spec.extensions.JAXRSClientITpasses 2/2 unexcluded against a rebuilt TomEE plus distribution; the widerjaxrs31.**slice passes 4/4.openejb-cxf-rssuite: 123 tests, the only failure beingEJBExceptionMapperTest.security, which fails identically on a clean checkout ofmain.🤖 Generated with Claude Code