-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IllegalStateException: CDI is not available
during EE 10 Platform TCK ejb30.lite.nointerface.descriptor.Client.invokeRemovedStateful_from_ejbembed test on JDK11
#23917
Comments
The problem is the contents of the war and the change in default behavior for CDI beans. The ejblite_nointerface_descriptor_ejblitejsf_vehicle_web.war has a faces-config.xml that defines a managed-bean, but the corresponding class com.sun.ts.tests.ejb30.lite.nointerface.descriptor.Client has no bean defining annotations. If I add an empty beans.xml to the war, it deploys fine. How is the faces-config.xml generated for this war? I can't see how to determine where managed-beans are used that don't have a beans.xml file in the ejb30/lite source tree. |
A little extra background; If there are zero beans found, Weld on its turn abort its initialisation, which has as a result that the bean manager can't be obtained, prompting Mojarra to say "CDI is not available". |
@arjantijms correct, this is a war with faces content. All similar wars need to be updated to address the changes in CDI default scanning behavior, but I don't see how the WEB-INF/faces-config.xml is generated for these wars to determine which are using managed-beans. |
I think the source xml is from https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/src/com/sun/ts/tests/common/vehicle/ejblitejsf/faces-config.xml and is referenced from various tests that need it indirectly via ant scripting. If we need to add an empty beans.xml, I think at least file https://github.com/eclipse-ee4j/jakartaee-tck/blob/master/bin/xml/ts.vehicles.xml would need a change.
Would the empty beans.xml need to include |
More specifically, I think the empty |
Since managed beans are removed now via jakartaee/faces#1547, should Faces 4.0 implementations fail to deploy applications with faces-config.xml that specify managed beans? |
The new Faces TCK has resolved the same failure by adding an empty beans.xml as suggested in jakartaee/faces#1600 (comment), so I think we can proceed to add an empty beans.xml (with bean-discovery-mode="all"). |
I will open a Platform TCK issue for addressing and soon close this issue. Thanks all! |
We didn't answer this question yet but I am thinking that Mojarra is not likely trying to process the jakarta.annotation.ManagedBean classes that might be listed in the faces-config.xml. I'm looking more closely at the failure to see if the eclipse-ee4j/mojarra@808d9ed change is correct for Faces 4.0. Opened eclipse-ee4j/mojarra#5080 for ^ |
I'm closing this due to Faces 4.0 SPEC having a hard requirement that all Faces 4.0 application deployments to be configured to enable CDI. We will deal with that in the Platform TCK, at least that is now the plan. |
During EE 10 (Full) Platform TCK testing we are seeing the below failure (see root/vi/glassfish7/glassfish/domains/domain1/logs/server.log in https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck/job/master/1758/artifact/ejb30_lite_nointerface-results.tar.gz):
Is ^ a Mojarra issue or more of an integration with CDI issue?
The text was updated successfully, but these errors were encountered: