Closed volosied closed 3 years ago
I attempted to the the new beans.xml in the faces-3.0 implementation, but encountered some deployment errors.
| Failures occured while waiting for app to start: Application ConverterValidatorBehaviorInjectionTarget failure: CWWKZ0002E: An exception occurred while starting the application ConverterValidatorBehaviorInjectionTarget. The exception message was: com.ibm.ws.container.service.state.StateChangeException:
org.jboss.weld.exceptions.DeploymentException: Exception List with 4 exceptions:
Application JSF23Spec1300 failure: CWWKZ0002E: An exception occurred while starting the application JSF23Spec1300. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: Exception List with 4 exceptions: Application ConvertDateTime failure:
CWWKZ0002E: An exception occurred while starting the application ConvertDateTime. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: Exception List with 4 exceptions: Application JSF23CDITests failure: CWWKZ0002E: An exception occurred while starting the application JSF23CDITests. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name oam_PUSH_CONTEXT_FACTORY_BEAN_NAME resolves to beans: [Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named], Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named]] Application JSF23Spec1433False failure:
CWWKZ0002E: An exception occurred while starting the application JSF23Spec1433False. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name oam_PUSH_CONTEXT_FACTORY_BEAN_NAME resolves to beans: [Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named], Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named]] Application CDIManagedProperty failure: CWWKZ0002E: An exception occurred while starting the application CDIManagedProperty. The exception message was: com.ibm.ws.container.service.state.StateChangeException:
-- | --
I reviewed this problem again.
I tested in two ways: 1) Changing the beans.xml within a JSF application
2) Changing the beans.xml withiin the JSF Implementation. See file here: https://github.com/OpenLiberty/open-liberty/blob/eeb6286c6338d8e13b14bdf83cc9d0ad216c9fcc/dev/io.openliberty.org.apache.myfaces.3.0/src/META-INF/beans.xml#L1-L3
Here's the beans.xml I tested with:
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd" version="3.0"
bean-discovery-mode="none">
<scan>
<exclude name="com.ibm.ws.faces.**" />
<exclude name="org.apache.myfaces.**"/>
</scan>
</beans>
I encountered the following error:
`[ERROR ] CWWKZ0002E: An exception occurred while starting the application CDIConfigByACP. The exception message was: com.ibm.ws.container.service.state.StateChangeException: org.jboss.weld.exceptions.DeploymentException: WELD-001414: Bean name is ambiguous. Name oam_PUSH_CONTEXT_FACTORY_BEAN_NAME resolves to beans: [Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named], Managed Bean [class org.apache.myfaces.push.cdi.PushContextFactoryBean] with qualifiers [@Default @Any @Named]]`
beans.xml issue has been reported to Weld here: https://issues.redhat.com/browse/WELD-2649 PR was merged, need to wait for it to be in a released build: https://github.com/weld/core/pull/2188
This issue should have been fixed by the PR to pull in Weld 4.0.0.Final - https://github.com/OpenLiberty/open-liberty/pull/16010 However, not going to close this issue until I have also added our own test - https://github.com/OpenLiberty/open-liberty/pull/16046
This issue can now be closed.
The Jakarta EE9 site says XML Schema for the beans.xml is in the final status stage.
This official beans.xml file is now:
However, I'm not sure if it's yet supported by WELD.