Fix for EAR Deployment Issue#522
Merged
Merged
Conversation
|
|
TatuLund
approved these changes
Jun 16, 2026
TatuLund
requested changes
Jun 17, 2026
TatuLund
left a comment
Contributor
There was a problem hiding this comment.
There are test failures that needs to be checked before merging.
TatuLund
approved these changes
Jun 17, 2026
Contributor
This was a setup issue. |
rodolforfq
added a commit
that referenced
this pull request
Jun 22, 2026
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.
Description
DeltaSpike's JMX MBeanExtension observes BeforeBeanDiscovery and, during that callback, resolves the DeltaSpike ProjectStage via ConfigResolver.getConfigProvider(). That method discovers its ConfigProvider implementation using ServiceLoader against the thread context classloader (TCCL).
When this add-on's WAR is nested inside an EAR on a Jakarta EE server (e.g. WildFly / JBoss EAP 8), the TCCL active during CDI bootstrap is the EAR (parent) classloader, which cannot see deltaspike-core-impl in the WAR's WEB-INF/lib. The lookup finds no provider and deployment fails with:
java.lang.RuntimeException: Could not load ConfigProviderThis PR adds a new CDI extension, DeltaSpikeConfigBootstrap, that primes and caches the DeltaSpike ConfigProvider early — while the TCCL is temporarily set to the WAR module classloader (which can see WEB-INF/lib). ConfigResolver caches the provider in a static field, so DeltaSpike's later lookup returns the cached instance and never re-runs the failing ServiceLoader scan. The priming is best-effort (failures are logged at FINE and fall back to the normal path), and is a negligible no-op cost for standalone WAR deployments where the problem doesn't occur.
Fixes #521
Type of change
Checklist