Exception: could not find Factory: javax.faces.context.FacesContextFactory

This is a sign of classpath pollution. JBoss already ships with JSF bundled. This exception can occur if you bundle JSF in your WAR as well. It’ll only collide.

There are 2 solutions:

  1. Get rid of jsf-api and jsf-impl JARs in your WAR (i.e. they should not end up in /WEB-INF/lib after build/deploy.

  2. Tell JBoss that your WAR ships with its own version of JSF so that JBoss won’t use its own.

    <context-param>
        <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
        <param-value>true</param-value>
    </context-param>
    

Leave a Comment