0
我目前正在研究以下堆棧:jboss7.1.3,javaee-api和jsf 2.1.19。並且無法避開這個錯誤:找不到工廠javax.faces.application.ApplicationFactory的備份
Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory.
這很奇怪,因爲當我不稀釋戰爭問題不會顯示。疏除戰爭意味着添加以下配置到Maven插件戰爭:
<configuration>
<failOnMissingWebXml>false</failOnMissingWebXml>
<packagingExcludes>WEB-INF/lib/*.jar</packagingExcludes>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<classpathPrefix>lib</classpathPrefix>
</manifest>
</archive>
</configuration>
我想我所有的罐子是在app/lib文件夾中,這樣就不會有LinkageError類。這是因爲我的Web項目也依賴於EJB項目。但問題是我有一個基類與正在通過的2個模塊使用,引發此錯誤的方法簽名:
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
我的想法是對的2個模塊1類加載器,在lib夾。所以這兩個模塊都將使用父代優先加載。
或者我的方法是完全錯誤的?任何建議?
相關http://stackoverflow.com/q/7957070/1530938 – kolossus