Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-84428

On restart Liferay runs ServletContainerInitializers with access to servlet container modules

Details

    Description

      Steps to reproduce:

      1. Start Liferay 7.0 + Wildfly.
      2. 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
        
      3. Deploy the attached reproducer:
         cp target/com.mycompany.my.jsf.portlet*.war $LIFERAY_WILDFLY_BUNDLE/deploy/.
        
      4. Add the portlet to a page.
      5. Reload the page.
      6. 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)]
        
      7. Restart Wildfly + Liferay.
      8. 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.

      Attachments

        Issue Links

          Activity

            People

              shuyang.zhou Shuyang Zhou
              kyle.stiemann Kyle Stiemann (Inactive)
              Kiyoshi Lee Kiyoshi Lee
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                4 years, 15 weeks, 4 days ago

                Packages

                  Version Package
                  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