Skip to content

Reverts the enhanced CDI integration added in RESTEASY-3755, which should not have gone into a maintenance release, and backports bug fixes from main. - #5130

Merged
jamezp merged 7 commits into
resteasy:6.2from
jamezp:backports-6.2
Nov 5, 2026

Conversation

@jamezp

@jamezp jamezp commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Reverted

  • RESTEASY-3822: Revert the enhanced CDI integration added by RESTEASY-3755
  • Reverts RESTEASY-3755 (dev.resteasy.cdi.enhanced.enabled, CDI injection of @*Param values and of @Context members through CDI), including its CI job
  • Reverts RESTEASY-3797, the producers for the Jakarta Servlet types, which were only required by RESTEASY-3755. Their @Default beans caused a WELD-001409 ambiguous resolution for applications which provide their own bean for one of these types
  • Restores the fix for RESTEASY-3752, which was part of the RESTEASY-3755 commit, with a new test

Release note

CDI injection of @*Param values, and of @Context members through CDI, controlled by dev.resteasy.cdi.enhanced.enabled, has been removed. It was added in error in a maintenance release and is available in RESTEasy 8.0. On 6.2 only applications which set dev.resteasy.cdi.enhanced.enabled=true are affected. HttpServletResponse and ServletConfig can no longer be injected with @Inject; use @Context.

Fixes

  • RESTEASY-3817: Push and restore the Configuration for a client invocation
  • RESTEASY-3819: Resolve the bean of the type itself when a subclass of a CDI managed resource is also a bean
  • RESTEASY-3821: Create the instance through the InjectorFactory in ResourceContext.getResource()
  • RESTEASY-3824: Remove the global ResteasyProviderFactory installed by a deployment which failed to start

… on the required Servlet types when Servlet is present."

This reverts commit accab09. The producers for the Jakarta Servlet types were only required for the enhanced CDI
integration of RESTEASY-3755, which is reverted. The @default beans they registered caused an ambiguous resolution,
WELD-001409, for applications which provide their own bean for one of these types.

https://redhat.atlassian.net/browse/RESTEASY-3822

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
@jamezp
jamezp requested a review from a team as a code owner November 5, 2026 00:52
jamezp and others added 6 commits November 4, 2026 19:25
…nnotated parameters with CDI. Ensure invalid CDI resource beans are ignored by the CDI extension and processed by RESTEasy."

This reverts commit f086afa. The enhanced CDI integration changed how RESTEasy and CDI interact in ways which
caused issues, e.g. RESTEASY-3790. Fixing them requires the CDI integration of RESTEASY-3807, which is part of
RESTEasy 8.0 and Jakarta REST 5.0.

The later changes to the same files from RESTEASY-3793, RESTEASY-3794 and RESTEASY-3797 are kept.

Release note: CDI injection of @*Param values, and of @context members through CDI, controlled by
dev.resteasy.cdi.enhanced.enabled, has been removed. It was added in error in a maintenance release and is available
in RESTEasy 8.0. On 7.0 it was enabled by default; on 6.2 only applications which set
dev.resteasy.cdi.enhanced.enabled=true are affected.

https://redhat.atlassian.net/browse/RESTEASY-3822

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
… RESTEASY-3755

The fix for RESTEASY-3752 was part of the RESTEASY-3755 commit. Do not
add a resource, provider or Application class which cannot be proxied to
the bean container, so RESTEasy creates it rather than failing the
deployment when CDI does not register it as a bean. A class is only
proxyable if it has a non-private no-arg constructor.

https://redhat.atlassian.net/browse/RESTEASY-3822

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
(cherry picked from commit 830141e)
Signed-off-by: James R. Perkins <[email protected]>
…ation

Push and restore the Configuration, as well as the Providers, for a
client invocation, so a provider shared by the client and server sees
the client's Configuration while the client invokes it.

https://redhat.atlassian.net/browse/RESTEASY-3817

Signed-off-by: James R. Perkins <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
(cherry picked from commit 2ec6e87)
Signed-off-by: James R. Perkins <[email protected]>
…f a CDI managed resource is also a bean

When a subclass of a CDI managed resource is also a bean, resolving the
bean of the resource class was ambiguous. Prefer the bean whose bean
class is the type, or an alternative.

https://redhat.atlassian.net/browse/RESTEASY-3819

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
(cherry picked from commit 51cb2a0)
Signed-off-by: James R. Perkins <[email protected]>
…sourceContext.getResource()

Create the constructor injector from the class with the InjectorFactory,
rather than picking the constructor first, so a CDI bean whose only
constructor is an @Inject constructor with parameters not annotated with
@context can be created.

https://redhat.atlassian.net/browse/RESTEASY-3821

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
(cherry picked from commit e783bfe)
Signed-off-by: James R. Perkins <[email protected]>
…y a deployment which failed to start

A failed start never reaches stop(), so the deployment's factory stayed
the global instance and was used by other deployments, e.g. their REST
clients.

https://redhat.atlassian.net/browse/RESTEASY-3824

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: James R. Perkins <[email protected]>
(cherry picked from commit b99bf46)
Signed-off-by: James R. Perkins <[email protected]>
@jamezp
jamezp merged commit eb31a76 into resteasy:6.2 Nov 5, 2026
10 checks passed
@jamezp
jamezp deleted the backports-6.2 branch November 5, 2026 14:54
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.

1 participant