我想将现有的icefaces应用程序迁移到jboss服务器7中,但是我收到了这个例外:
15:01:27,399 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC ser
vice thread 1-2) Critical error during deployment: : com.sun.faces.config.Config
urationException: Factory 'javax.faces.context.ExceptionHandlerFactory' was not
configured properly.
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactories
Exist(FactoryConfigProcessor.java:305) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.processor.FactoryConfigProcessor.process(Factory
ConfigProcessor.java:219) [jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:361)
[jsf-impl-2.1.7-jbossorg-2.jar:]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi
stener.java:225) [jsf-impl-2.1.7-jbossorg-2.jar:]
at org.apache.catalina.core.StandardContext.contextListenerStart(Standar
dContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentS
ervice.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se
rviceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont
rollerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110) [rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603) [rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
Caused by: javax.faces.FacesException: org.icefaces.impl.application.ExtendedExc
eptionHandlerFactory
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java
:643) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.FactoryFinder.getImplementationInstance(FactoryFinder.jav
a:509) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.FactoryFinder.access$400(FactoryFinder.java:139) [jboss-j
sf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.jav
a:993) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-j
sf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
at com.sun.faces.config.processor.FactoryConfigProcessor.verifyFactories
Exist(FactoryConfigProcessor.java:303) [jsf-impl-2.1.7-jbossorg-2.jar:]
... 11 more
Caused by: java.lang.InstantiationException: org.icefaces.impl.application.Exten
dedExceptionHandlerFactory
at java.lang.Class.newInstance0(Class.java:357) [rt.jar:1.7.0]
at java.lang.Class.newInstance(Class.java:325) [rt.jar:1.7.0]
at javax.faces.FactoryFinder.getImplGivenPreviousImpl(FactoryFinder.java
:641) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
... 16 more
我只是陷入困境,因为我不知道如何解决这个问题。
有人有线索吗?
我在我的lib目录中有javax.faces.jar
,但似乎删除它没有帮助(我收到很多其他例外)。
更新:如果我将此添加到web.xml:
<context-param>
<param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
<param-value>true</param-value>
</context-param>
错误似乎消失了,但又出现了另一个错误:
15:56:51,975 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-
host].[/cloudmatrix]] (MSC service thread 1-3) Exception sending context initial
ized event to listener instance of class com.sun.faces.config.ConfigureListener:
java.lang.RuntimeException: com.sun.faces.config.ConfigurationException: CONFIG
URATION FAILED! Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider i
s not an instance of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi
stener.java:292) [javax.faces.jar:2.1.6-SNAPSHOT]
at org.apache.catalina.core.StandardContext.contextListenerStart(Standar
dContext.java:3392) [jbossweb-7.0.13.Final.jar:]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3
850) [jbossweb-7.0.13.Final.jar:]
at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentS
ervice.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(Se
rviceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceCont
rollerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110) [rt.jar:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603) [rt.jar:1.7.0]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0]
Caused by: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Cl
ass org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance
of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:375)
[javax.faces.jar:2.1.6-SNAPSHOT]
at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureLi
stener.java:225) [javax.faces.jar:2.1.6-SNAPSHOT]
... 8 more
Caused by: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.Jan
dexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
at com.sun.faces.spi.AnnotationProviderFactory.createAnnotationProvider(
AnnotationProviderFactory.java:78) [javax.faces.jar:2.1.6-SNAPSHOT]
at com.sun.faces.config.ConfigManager$AnnotationScanTask.<init>(ConfigMa
nager.java:807) [javax.faces.jar:2.1.6-SNAPSHOT]
at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:348)
[javax.faces.jar:2.1.6-SNAPSHOT]
... 9 more
答案 0 :(得分:0)
我不得不将jboss-deployment-structure.xml放在我的耳中:
<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
<exclusions>
<module name="javax.faces.api" slot="main"/>
<module name="com.sun.jsf-impl" slot="main"/>
<module name="javax.faces.api" slot="1.2"/>
<module name="com.sun.jsf-impl" slot="1.2"/>
<module name="org.jboss.as.web" slot="main" />
</exclusions>
<dependencies>
<module name="org.hibernate.validator" export="true"/>
<module name="javax.validation.api" export="true"/>
<module name="org.codehaus.jettison" export="true"/>
<module name="org.jboss.resteasy.resteasy-jaxrs" export="true"/>
<module name="org.jboss.resteasy.resteasy-jackson-provider" export="true"/>
<module name="org.apache.log4j" export="true"/>
<module name="org.jboss.as.web" slot="main" export="true"/>
<module name="javax.faces.api" slot="main" export="true"/>
<module name="com.sun.jsf-impl" slot="main" export="true"/>
<module name="org.jboss.as.web" slot="main">
<imports>
<include path="/org/**" />
<exclude path="/META-INF/**" />
</imports>
</module>
</dependencies>
</deployment>
</jboss-deployment-structure>