1 Reply Latest reply on Jun 22, 2015 10:16 AM by fjuma

    Multiple versions of JSF (1.2 & 2.2) won't work in the same ear deployment

    cdclose

      We've tried both JBoss release versions 8.2.0.Final and 9.0.0.CR2. In JBoss 6 we were able to deploy an EAR which contained multiple WARs using different versions of JSF. Specifically JSF 1.x in one and JSF 2.x in the other. In trying to migrate our application to JBoss 8 (wildfly) we've found that we're no longer able to have multiple sub-deployments that use different versions. Initially we thought we could configure the different versions with the JSF_CONFIG_NAME context-param in the web.xml of each WAR as we did in JBoss 6 without using a jboss-deployment-structure.xml. When that didn't work we attempted to use the jboss-deployment-structure.xml to configure the dependencies/exclusions for each sub-deployment but always run into an issue with the JSF injection and find that only one version of JSF is being used.


      Our deployment structure was configured like this:

      <?xml version="1.0"?>

      <jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

        <deployment>

        </deployment>

        <sub-deployment name="chassisdemo-web-legacy.war">

              <exclusions>

                  <module name="javax.faces.api" slot="main"/>

                  <module name="com.sun.jsf-impl" slot="main"/>

              </exclusions>

              <dependencies>

                  <module name="javax.faces.api" slot="mojarra-1.2_15"/>

                  <module name="com.sun.jsf-impl" slot="mojarra-1.2_15"/>

              </dependencies>

          </sub-deployment>

          <sub-deployment name="weld-numberguess.war">

              <exclusions>

                  <module name="javax.faces.api" slot="mojarra-1.2_15"/>

                  <module name="com.sun.jsf-impl" slot="mojarra-1.2_15"/>

              </exclusions>

              <dependencies>

                  <module name="javax.faces.api" />

                  <module name="com.sun.jsf-impl" />

              </dependencies>

          </sub-deployment>

      </jboss-deployment-structure>

       

      Here is the error we are seeing:

      ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 61) MSC000001: Failed to start service jboss.undertow.deployment.default-server.default-host./legacy: org.jboss.msc.service.StartException in service jboss.undertow.deployment.default-server.default-host./legacy: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:85)

              at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

              at java.util.concurrent.FutureTask.run(FutureTask.java:266)

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)

              at java.lang.Thread.run(Thread.java:745)

              at org.jboss.threads.JBossThread.run(JBossThread.java:320)

      Caused by: java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"

              at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:224)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:100)

              at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:82)

              ... 6 more

      Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:214)

              at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:200)

              at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:173)

              at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:195)

              ... 8 more

      Caused by: java.lang.IllegalAccessException: Class javax.faces.FactoryFinder can not access a member of class org.jboss.as.jsf.injection.weld.WeldApplicationFactory with modifiers "private"

              at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)

              at java.lang.Class.newInstance(Class.java:436)

              at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java:537)

              at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.java:405)

              at javax.faces.FactoryFinder.access$400(FactoryFinder.java:135)

              at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:717)

              at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:239)

              at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactoriesExist(FactoryConfigProcessor.java:187)

              at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:132)

              at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:204)

              ... 11 more

       

      The attachment contains the CLI archive for the JSF 1.2 module we added to JBoss and an EAR containing multiple WAR sub-deployments (One for JSF 1.2  and one for JSF 2.2).