-
Task
-
Resolution: Unresolved
-
Major
-
None
-
None
-
None
Section 11.2.3 of the Jakarta REST Spec requires that applications, providers and resources should have a default CDI scope.
In a product that supports CDI, implementations MUST support the use of CDI-style Beans as root resource classes, providers and Application subclasses. Providers and Application subclasses MUST be singletons or use application scope.
For example, assuming CDI is enabled via the inclusion of a beans.xml file, a CDI-style bean that can be defined as a JAX-RS resource as follows:
Previously this was likely not an issue with an empty beans.xml. However, with the change to the default value of bean-discovery-mode to annotated this may require changes to deployments. If we add @ApplicationPath, @Provider and @Path as bean defining annotation this will allow these to be treated as CDI beans. The one catch is if a type extends jakarta.ws.rs.core.Application and does not have a @ApplicationPath annotation, then it will likely not be discovered.
- is related to
-
WFLY-8136 Allow JAX-RS annotations in CDI @Stereotype
- Closed
-
WFLY-2859 Treating all JAX-RS components as CDI Beans has some negative consequences
- Closed
- relates to
-
RESTEASY-1821 Allow JAX-RS annotations in CDI @Stereotype
- Closed