Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jakartaee-tck-dev] compatibility alert: Do (Platform TCK) tests that use Faces need CDI to be enabled (perhaps via empty beans.xml)?

On Fri, Apr 29, 2022, 6:57 PM arjan tijms <arjan.tijms@xxxxxxxxx> wrote:

Thanks! I wonder if, in the future, it may be possible to have an SPI in CDI available so that Faces, after having discovered Faces content, can forcefully init CDI.

E.g. Faces is initialized by a ServletContainerInitialiser, and CDI often is as well. The order is unknown, but Faces could put a hint in the context for if CDI initializes later, and CDI could put a callback in the context if it executed but decided to not go ahead. That callback could be called by the Faces ServletContainerInitialiser to initialize CDI anyway. may give some guidance on this.  Hibernate ORM and WildFly has been handling this for many years (following advice from CDI/Weld team) and can also be an example.  

I believe that Hibernate ORM also uses the CDI SPI to init CDI for applications that do not enable CDI.  I am on my phone now, so cannot give example code links.


Just some thoughts.

Kind regards,
Arjan Tijms

On Fri, Apr 29, 2022 at 9:53 PM Scott Marlow <smarlow@xxxxxxxxx> wrote:

On 4/29/22 10:45 AM, arjan tijms wrote:

On Fri, Apr 29, 2022 at 3:58 PM Scott Marlow <smarlow@xxxxxxxxxx> wrote:

I would like confirmation that the Faces 4.0 SPEC team agrees that all (Faces 4.0) application deployment requires CDI to be enabled which is a breaking change and probably should be added to the Faces 4.0 SPEC document.

Essentially Faces has required CDI to be available since JSF 2.3. Various features (such as custom data models) required CDI in that version.

So it's true that Faces 4.0 requires CDI, but it's somewhat debatable given its history whether that's 100% a new change in 4.0. Nevertheless we can add it explicitly in the spec that it's a strict requirement.

Thanks Arjan! is a draft pull request for adding the beans.xml that seems to avoid the "java.lang.IllegalStateException: CDI is not available" from being thrown from the `ejblitejsf` tests that include the faces-config.xml.  The `ejblitejsf` tests seem to still fail (will have to figure out why). 

I started a longer test run to see what the impact is of the change via


Kind regards,
Arjan Tijms


jakartaee-tck-dev mailing list
To unsubscribe from this list, visit

Back to the top