Skip to content

Fix for EAR Deployment Issue#522

Merged
TatuLund merged 1 commit into
4.0from
4.0-ear-issue
Jun 17, 2026
Merged

Fix for EAR Deployment Issue#522
TatuLund merged 1 commit into
4.0from
4.0-ear-issue

Conversation

@onuridrisoglu

Copy link
Copy Markdown
Collaborator

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 ConfigProvider

This 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

  • Bugfix
  • Feature

Checklist

  • I have read the contribution guide: https://vaadin.com/docs/latest/guide/contributing/overview/
  • I have added a description following the guideline.
  • The issue is created in the corresponding repository and I have referenced it.
  • I have added tests to ensure my change is effective and works as intended.
  • New and existing tests are passing locally with my change.
  • I have performed self-review and corrected misspellings.

@onuridrisoglu
onuridrisoglu requested a review from TatuLund June 16, 2026 10:18
@cla-assistant

cla-assistant Bot commented Jun 16, 2026

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@TatuLund TatuLund left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are test failures that needs to be checked before merging.

@TatuLund
TatuLund merged commit 792af54 into 4.0 Jun 17, 2026
2 of 4 checks passed
@TatuLund
TatuLund deleted the 4.0-ear-issue branch June 17, 2026 07:10
@TatuLund

Copy link
Copy Markdown
Contributor

There are test failures that needs to be checked before merging.

This was a setup issue.

rodolforfq added a commit that referenced this pull request Jun 22, 2026
rodolforfq added a commit that referenced this pull request Jun 23, 2026
…ackport) (#520)

* feat: Create Vaadin 7 EM/Jakarta version of CDI-4 (WIP)

* Additional changes and cleanup of test cases

* Backport of #522 to V7 branch.

* Added validation workflow from V8 branch.

---------

Co-authored-by: Rodolfo Felipe <rodolfo@vaadin.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants