WELD-001408 & ValidationInterceptor & Glassfish 4.0x & EAR & CODi can not deploy?

330 Views Asked by At

I am migrating our JSF/Primefaces 3.5.x GF 3.1.1 app to GF 4.0. It is an EAR with a war and an EJB-jar and lib full of jars.

The WAR has WEB-INF/lib has:

'org.apache.myfaces.extensions.cdi.core:myfaces-extcdi-core-api:1.0.5', 'org.apache.myfaces.extensions.cdi.core:myfaces-extcdi-core-impl:1.0.5',
'org.apache.myfaces.extensions.cdi.modules:myfaces-extcdi-jsf20-module-api:1.0.5', 'org.apache.myfaces.extensions.cdi.modules:myfaces-extcdi-jsf20-module-impl:1.0.5',

in addition to PF stuff and Omnifaces and some other dependencies (codi messages api & impl gets included too -- must be a transitive dep). NOTE: no CODi Validation stuff is in the WAR nor is there any hibernate jars.

The EAR Lib has a bunch of jars too -- it doesn't duplicate the CODi stuff and omits PF it does include some spring and velocity stuff, apache commons and a few other things -- AGAIN no CODi validator stuff or hibernate stuff.

On deploy I get:

org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [Validator] with qualifiers [@Default] at injection point [[UnbackedAnnotatedField] @Inject private org.hibernate.validator.internal.cdi.interceptor.ValidationInterceptor.validator]

I have seen the 2 other SO posts related to this:

WELD-001408 Unsatisfied dependencies for type [Validator]

&

CDI / Weld Unsatisfied dependencies proglem

Neither sheds any light as both suggest the CODI validator is behind the issue -- but I simply don't have that in my deployment unit (or EAR).

Is there anyway to work around this?

Switching to DeltaSpike (and/or the OS890 codi DS combo) is not a immediate option ; nor is using ee7. I need to try and get this to work with as few code changes as possible.

Any ideas?

2

There are 2 best solutions below

3
msc1979 On

I found the following solution:

In the "myfaces-extcdi-jsf20-module-impl-1.0.5.jar" remove the package "org.apache.myfaces.extensions.cdi.jsf.impl.bv" completely.

Nothing perfect, but works for me so far...

3
Dar Whi On

They just tweeted that the latest Snapshot can be used with EE7. I guess nobody reported the issue back (at least I haven't seen a JIRA-ticket until today).