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

前端 未结 3 1740
被撕碎了的回忆
被撕碎了的回忆 2020-11-30 12:29

I\'m migrating from JBoss 5.1.0.GA to JBoss 6.0.0-Final and facing following exception during FacesServler initialization

2011-03-09 18:07:24,574 ERROR [org.         


        
相关标签:
3条回答
  • 2020-11-30 13:15

    I was having the same problem with Jboss EAP 6.1 and 6.3.

    I´m using Maven, then, my problem was about the generation of the EAR file, when I´m using Maven I discovered that my EAR file was been deployed whith dependencies "exploded", that is to say, my EAR file was been deployed with a folder containing the files for my project, and not a WAR and a JAR files.

    When investigating the differences between the exploded EAR directory and the EAR archive I discovered that what you see is not what you get with Maven. I think the issue is that the various Maven plugins for WAR and EAR building are not applied when creating the exploded directories.

    To fix it, I just removed the 'unpack' directives from the POM for the EAR.

    <modules>  
            <webModule>  
                      <groupId>br.web</groupId>  
                      <artifactId>Web</artifactId>  
                      <contextRoot>/project</contextRoot>  
                      <unpack>false</unpack>
            </webModule>  
            <ejbModule>  
                      <groupId>br.ejb</groupId>  
                      <artifactId>Ejb</artifactId>  
                      <unpack>false</unpack>  
            </ejbModule>
      </modules>  
    

    In addition, I don't recommend that exploded directories should be used in a EAR file.

    0 讨论(0)
  • 2020-11-30 13:19

    I had the same issue, but with embedded GlassFish v3. I added this and it worked:

    <listener>
        <listener-class>com.sun.faces.config.ConfigureListener</listener-class>
    </listener>
    

    Here is the web page explains the problem: Using JSF 1.2 with Facelets on Google App Engine.

    0 讨论(0)
  • 2020-11-30 13:21

    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>
      
    0 讨论(0)
提交回复
热议问题