Maven 找不到factory javax.faces.application.ApplicationFactory的备份

Maven 找不到factory javax.faces.application.ApplicationFactory的备份,maven,jsf-2,jboss7.x,java-ee-6,Maven,Jsf 2,Jboss7.x,Java Ee 6,我目前正在开发以下堆栈:jboss7.1.3、JavaEEAPI和JSF2.1.19。无法绕过此错误: Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory. java.lang.Linka

我目前正在开发以下堆栈:jboss7.1.3、JavaEEAPI和JSF2.1.19。无法绕过此错误:

Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
java.lang.LinkageError: loader constraint violation: when resolving method "com.czetsuya.myApp.bean.MyManagedBean.getEntity()Lcom/czetsuya/myApp/model/MyEntity;" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the current class, com/czetsuya/myApp/util/view/composite/BackingBeanBasedCompositeComponent, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for resolved class, com/czetsuya/myApp/bean/MyManagedBean, have different Class objects for the type pship/model/MyEntity; used in the signature
这很奇怪,因为如果我不把战争看清楚,问题就不会显现出来。细化war意味着向maven war插件添加以下配置:

<configuration>
    <failOnMissingWebXml>false</failOnMissingWebXml>
    <packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
    <archive>
        <manifest>
            <addClasspath>true</addClasspath>
            <classpathPrefix>lib</classpathPrefix>
        </manifest>
    </archive>
</configuration>
我的想法是在lib文件夹中为这两个模块提供一个类加载器。因此,这两个模块都将首先使用父级加载


还是我的方法完全错了?有什么建议吗?

基本上,我所做的是删除jsf依赖项并坚持使用javaee api。这个解决方案对我有效。依赖jsf*.jar和javaee6 api jar会产生一些难以调试的错误。