I'm trying to migrate my JSF application to CDI. I have implented the following changes:
- Added an empty beans.xml file to WEB-INF
- Changed @ManagedBean 's to @Named
- Changed All the scopes I have to CDI Scopes (Session, View, Request)
- Changed all @EJB and @ManagedProperty to @Inject
However, an Omnifaces error is preventing deployment as I'm getting the following error three times:
org.jboss.weld.exceptions.DeploymentException: WELD-001409 Ambiguous dependencies for type [EagerBeansRepository] with qualifiers [@Default] at injection point [[BackedAnnotatedField] @Inject private org.omnifaces.ApplicationListener.eagerBeansRepository]. Possible dependencies [[Managed Bean [class org.omnifaces.cdi.eager.EagerBeansRepository] with qualifiers [@Any @Default], Managed Bean [class org.omnifaces.cdi.eager.EagerBeansRepository] with qualifiers [@Any @Default]]]
I have downgraded to Omnifaces 1.8.1 and the deployment was successful. Why Omnifaces 2.0 resulting in this error?
Development Environment:
- Glassfish 4
- Omnifaces 2.0
- JSF (Mojarra 2.2.0)
- WELD-000900 2.0.0 (SP1)