Section 1.8 of the Portlet 3.0 Specification titled "Relationship to Java Enterprise Edition" states:
The Portlet API v3.0 is based on the Java Standard Edition 7.0 and Java Enterprise Edition v7.0. Portlet containers should at least meet the requirements described by the Java EE 7.0 specification for executing in a Java EE environment.
Pluto 3.x implements the Portlet 3.0 API and targets Java EE 7, which includes the CDI 1.2 API and the Bean Validation 1.1 API. . As such, it relies on JBoss Weld 2.3.1.Final (which implements the CDI 1.2 API).
When trying to upgrade to hibernate-validator-6.0.20.Final via
PLUTO-791, the attached stacktrace.txt started happening when trying to onblur out of the "Postal Code" field of the applicant-mvcbean-cdi-jsp-portlet demo. This revealed that hibernate-validator-6.0.20.Final was attempting to call the javax.enterprise.inject.spi.BeanManager.createInstance() method, which the Javadoc indicates was introduced in CDI 2.0 (Java EE 8).
Upon closer examination, the Hibernate Validator Releases page states that version 6.0 targets Bean Validation 2.0, which explains why the Hibernate Validator implementation of the Bean Validation API would be permitted to call version 2.0 method signatures in the CDI API such as the aforementioned BeanManager.createInstance().
The Hibernate Validator FAQ page states that Hibernate Validator 5.x is the reference implementation of Bean Validation 1.1 (JSR 349). In addition, the project's main pom.xml descriptor corroborates the FAQ. Therefore, in order to be compatible with CDI 1.2 and Bean Validation 1.1 (Java EE 7), it is necessary to downgrade to the newest version of Hibernate Validator 5.x (which is hibernate-validator-5.4.3.Final at the time of this writing) and validation-api-1.1.0.Final
This task involves downgrading from the following dependency versions:
In addition, since the demo and archetypes use Bean Validation 2.0 annotations such as:
... it will be necessary to use their Bean Validation 1.2 counterparts, which are vendor-specific to Hibernate Validator: