-
Type:
Bug
-
Status: Closed
-
Resolution: Fixed
-
Affects Version/s: 7.0.6 CE GA7, 7.0.0 DXP FP56, 7.1.10 DXP GA1
-
Fix Version/s: 7.0.0 DXP FP58, 7.0.0 DXP SP9, 7.0.X, 7.1.10 DXP FP2, 7.1.1 CE GA2, 7.1.10.1 SP1, 7.1.X, Master
-
Branch Version/s:7.1.x, 7.0.x
-
Backported to Branch:Committed
-
Git Pull Request:
Steps to reproduce:
- Start Liferay 7.0 + Wildfly.
- Download, unzip, and build the attached project:
cd ~/Downloads && unzip com.mycompany.my.jsf.portlet.zip && cd com.mycompany.my.jsf.portlet && mvn clean package
- Deploy the attached reproducer:
cp target/com.mycompany.my.jsf.portlet*.war $LIFERAY_WILDFLY_BUNDLE/deploy/.
- Add the portlet to a page.
- Reload the page.
- Confirm that the following text appears, showing that the Faces ValidationFactory is unavailable (because no Bean Validation provider/implementation, such as Hibernate Validator (RI), is available on the reproducer's classpath):
applicationMap['javax.faces.validator.beanValidator.ValidatorFactory']=null applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class=null applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class.classLoader=null Class.forName('org.jboss.as.ee.beanvalidation.LazyValidatorFactory')=null facesContext.class.[email protected]2af0444b[com.mycompany.my.jsf.portlet:1.0.0(id=589)]
- Restart Wildfly + Liferay.
- Navigate to the reproducer page.
If the bug still exists, the following text will appear:
applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'][email protected] applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class=class org.jboss.as.ee.beanvalidation.LazyValidatorFactory applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class.classLoader=ModuleClassLoader for Module "org.wildfly.extension.bean-validation:main" from local module loader @5a4041cc (finder: local module finder @15b3e5b (roots: /home/kylestiemann/Portals/liferay.com/liferay-dxp-digital-enterprise-wildfly-7.0-sp7/wildfly-10.0.0/modules,/home/kylestiemann/Portals/liferay.com/liferay-dxp-digital-enterprise-wildfly-7.0-sp7/wildfly-10.0.0/modules/system/layers/base)) Class.forName('org.jboss.as.ee.beanvalidation.LazyValidatorFactory')=null facesContext.class.[email protected]6dd3204[com.mycompany.my.jsf.portlet:1.0.0(id=589)]
The text indicates that javax.faces.validator.beanValidator.ValidatorFactory has been populated by the Faces ApplicationConfigProcessor even though the war does not or should not have access to org.jboss.as.ee.beanvalidation.LazyValidatorFactory (the implementation class).
If the bug is fixed, the following text will appear (as it did when the portlet was first deployed):
applicationMap['javax.faces.validator.beanValidator.ValidatorFactory']=null applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class=null applicationMap['javax.faces.validator.beanValidator.ValidatorFactory'].class.classLoader=null Class.forName('org.jboss.as.ee.beanvalidation.LazyValidatorFactory')=null facesContext.class.[email protected]2af0444b[com.mycompany.my.jsf.portlet:1.0.0(id=589)]
This may also be an issue in Tomcat, however it cannot be reproduced there since Mojarra is not included in the global Tomcat classpath.