Sunday, March 17, 2013

Upgrade JSF version in JBoss AS 7.1.1.Final

The JBoss AS 7.1.1 Final ships with Mojarra implementation of JSF versions 1.2 and 2.1.7. However sometimes developers need to change or upgrade the JSF version.
Prior to this JBoss version web applications could load their own JSF by placing the jar in WEB-INF/lib and adding the following context-param in web.xml.


But this doesn't work anymore for 7.1.1. Following is how you can do it.
At the time of this writing I have used version 2.1.19.
  • First you need to download the jsf-impl and jsf-api jars that you want. Here are the MVN Repository for jsf-impl and jsf-api.
  • Place the jsf-impl jar in the path modules/com/sun/jsf-impl/main.
  • Open the module.xml of that directory and change the value of path of resource-root as

  • Now place the jsf-api jar in the path modules/javax/faces/api/main.
  • Open the module.xml of that directory and change the value of path of resource-root as

  • Because jsf-api depends on jsf-impl you need to add the dependency in the module of jsf-api as

Now you are good to run you server. While running the server if you see the following line:
14:14:08,379 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.1.19 ( 20130213-1512 for context '/your-app'
Then everything is fine.
Good luck.


  1. Hi,

    Thanks for the post. We have an old application developed in JSF 1.2 with ICEFaces 1.8 and was running fine in Jboss 5.1 GA. Now,we need to migrate that app to JBoss 7.1.1. We want to use JSF 1.2 in JSF, instead of 2.1.7 which it supports by default. This is because if we upgrade to JSF 2.1.7 we need to upgrade the version of ICEFaces to 3.x from current version of 1.8.But, we are not supposed to migrate ICefaces version - rather downgrade JSF version.

    My question is how to downgrade to JSF 1.2 in JBoss 7.1.1?

    1. Hello Rajarshi,
      I have written another post on this topic. You can also find a sample application as attachment there.

  2. i'm getting the following the error while deploying jsf webapplication into jboss as 7.1.1 final

    10:18:14,809 ERROR [] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.unit."eureQAWebApp.war".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.unit."eureQAWebApp.war".POST_MODULE: Failed to process phase POST_MODULE of deployment "eureQAWebApp.war"
    at [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService( [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$ [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor.runWorker( [rt.jar:1.7.0_01]
    at java.util.concurrent.ThreadPoolExecutor$ [rt.jar:1.7.0_01]
    at [rt.jar:1.7.0_01]
    Caused by: java.lang.NoClassDefFoundError: org/apache/commons/collections/Predicate
    at java.lang.Class.getDeclaredConstructors0(Native Method) [rt.jar:1.7.0_01]
    at java.lang.Class.privateGetDeclaredConstructors( [rt.jar:1.7.0_01]
    at java.lang.Class.getConstructor0( [rt.jar:1.7.0_01]
    at java.lang.Class.getConstructor( [rt.jar:1.7.0_01]
    at [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]
    ... 5 more
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.collections.Predicate from [Module "deployment.eureQAWebApp.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(
    at org.jboss.modules.ConcurrentClassLoader.loadClass(
    ... 11 more

    1. Hi Laxmi, from your stacktrace it is clear that your application is unable to load a class org.apache.commons.collections.Predicate.

    2. But the module (org/apache/commons/collections) is exist in jboss as 7.1.1
      Is there any procedure to load Predicate class