当前位置: 首页 > 知识库问答 >
问题:

JBoss 7.1.1.最终部署错误:JandexAnnotationProvider不是AnnotationProvider的实例

吴胜涝
2023-03-14

我正在将web应用程序迁移到JBoss7.1.1.final。该应用程序的结构如下:

app.ear
|--- \lib
|       |-- jsf-api-2.0.2.jar, jsf-impl-2.0.2.jar, jsp-api-2.1.jar, jstl-1.2.jar    
|
|--- \META-INF
|--- \web.war
|       |-- \WEB-INF
|       |       |-- web.xml
|       |
|
|--- \ejbs.jar
<context-param>
    <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
    <param-value>true</param-value>
</context-param>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.2">

<ear-subdeployments-isolated>false</ear-subdeployments-isolated>

<deployment>
    <exclusions>
        <!-- Exclude container version of hibernate. By default its version 4, 
            we want bundled version 3 loaded -->
        <module name="org.hibernate" slot="main" />
        <module name="org.hibernate.validator" slot="main" />
        <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" />
    </exclusions>

    <dependencies>
        <!-- Add dependencies, since in 'pom.xml' we exclude transitive dependencies 
            from reactor, we need to add following modules, to make application work 
            properly -->
        <!-- NOTE: module name does not always correspond to maven artifact ID -->
        <!-- Add dependency on commons.logging -->
        <module name="org.apache.commons.logging" />
        <!-- Add dependency on commons.collections -->
        <module name="org.apache.commons.collections" />
        <module name="org.apache.commons.lang" />
        <!-- Add dependency on log4j -->
        <module name="org.apache.log4j" export="true"/>
        <!-- Add dependency on dom4j -->
        <module name="org.dom4j" />
        <!-- Add dependency on slf4j -->
        <module name="org.slf4j" />
        <!-- Add dependency on antlr -->
        <module name="org.antlr" />
        <!-- Add dependency on asm -->
        <module name="asm.asm" />
        <!-- Add dependency on javassist -->
        <module name="org.javassist" />
        <module name="org.hibernate" slot="3" />
        <module name="org.hibernate.validator" slot="3" />
    </dependencies>

</deployment>

当试图部署此应用程序时,服务器引发以下异常:

   17:39:00,826 SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (MSC service thread 1-8) JSF1051: Service entry 'org.jboss.as.web.deployment.jsf.JsfInjectionProvider' does not extend DiscoverableInjectionProvider.  Entry will be ignored.17:39:00,828 INFO  [javax.enterprise.resource.webcontainer.jsf.application] (MSC service thread 1-8) JSF1048: PostConstruct/PreDestroy annotations present.  ManagedBeans methods marked with these annotations will have said annotations processed.
17:39:00,903 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Unsanitized stacktrace from failed start...: javax.faces.FacesException: java.util.concurrent.ExecutionException: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
    at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:411) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.AbstractConfigProcessor.processAnnotations(AbstractConfigProcessor.java:328) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.ApplicationConfigProcessor.process(ApplicationConfigProcessor.java:334) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.LifecycleConfigProcessor.process(LifecycleConfigProcessor.java:116) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.AbstractConfigProcessor.invokeNext(AbstractConfigProcessor.java:114) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.processor.FactoryConfigProcessor.process(FactoryConfigProcessor.java:223) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:335) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: java.util.concurrent.ExecutionException: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
    at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:222) [rt.jar:1.6.0_07]
    at java.util.concurrent.FutureTask.get(FutureTask.java:83) [rt.jar:1.6.0_07]
    at com.sun.faces.config.ConfigManager.getAnnotatedClasses(ConfigManager.java:407) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    ... 16 more
Caused by: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
    at com.sun.faces.spi.AnnotationProviderFactory.createAnnotationProvider(AnnotationProviderFactory.java:74) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:764) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_07]
    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_07]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    ... 9 more

17:39:00,931 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/war]] (MSC service thread 1-8) Exception sending context initialized event to listener instance of class com.sun.faces.config.ConfigureListener: com.sun.faces.config.ConfigurationException: CONFIGURATION FAILED! Class 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:354) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextInitialized(ConfigureListener.java:223) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]
Caused by: javax.faces.FacesException: Class org.jboss.as.web.deployment.jsf.JandexAnnotationProvider is not an instance of com.sun.faces.spi.AnnotationProvider
    at com.sun.faces.spi.AnnotationProviderFactory.createAnnotationProvider(AnnotationProviderFactory.java:74) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:764) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigManager$AnnotationScanTask.call(ConfigManager.java:736) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_07]
    at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_07]
    at com.sun.faces.config.ConfigManager.initialize(ConfigManager.java:329) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    ... 9 more

17:39:00,948 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Error listenerStart
17:39:00,949 ERROR [org.apache.catalina.core.StandardContext] (MSC service thread 1-8) Context [/war] startup failed due to previous errors
17:39:00,952 SEVERE [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-8) Unexpected exception when attempting to tear down the Mojarra runtime: java.lang.IllegalStateException: Application was not properly initialized at startup, could not find Factory: javax.faces.application.ApplicationFactory
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:804) [jsf-api-2.0.2.jar:2.0.2-FCS]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:306) [jsf-api-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:104) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at com.sun.faces.config.ConfigureListener.contextDestroyed(ConfigureListener.java:309) [jsf-impl-2.0.2.jar:2.0.2-FCS]
    at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:3489) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.stop(StandardContext.java:3999) [jbossweb-7.0.13.Final.jar:]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3917) [jbossweb-7.0.13.Final.jar:]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

17:39:00,968 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC00001: Failed to start service jboss.web.deployment.default-host./war: org.jboss.msc.service.StartException in service jboss.web.deployment.default-host./war: JBAS018040: Failed to start context
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:95)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.2.GA.jar:1.0.2.GA]
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885) [rt.jar:1.6.0_07]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907) [rt.jar:1.6.0_07]
    at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_07]

我做了很多研究,但没有解决这个问题。有人知道出路吗?

共有1个答案

谢财
2023-03-14

您可能需要通过向procject添加jboss-deployment-structure.xml来排除服务器的JSF实现。

<jboss-deployment-structure>
    <deployment>
        <!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
        <exclusions>
            <module name="javax.faces.api" />
        </exclusions>
        <dependencies>
            <module name="javax.el.api" export="true"/>
            <module name="javax.servlet.api" export="true"/>
            <module name="javax.servlet.jsp.api" export="true"/>
            <module name="javax.servlet.jstl.api" export="true"/>
            <module name="javax.validation.api" export="true"/>
        </dependencies>
    </deployment>
</jboss-deployment-structure>

关于Hibernate,您不需要在应用程序中包含Hibernate。您可以告诉服务器使用Hibernate3.5。

 类似资料:
  • 我想在java中使用soap ws部署war,但显示了以下错误 原因:java。lang.LinkageError:接口itable初始化中的加载程序约束冲突:解析方法“$Proxy182.setElementType(Ljavax/xml/namespace/QName;”V“当前类$Proxy182的类加载器(org/jboss/classloader/spi/base/BaseClassLo

  • 我在过去多次部署Firebase功能。由于某些原因,最近(大约2-3天)我经常在部署时出错。我使用windows来释放代码。当我尝试在我的Linux系统和Mac系统中设置相同的项目时,部署工作正常。从Windows环境发布可能存在的问题。 以下是部署时遇到的问题。 ! 功能[付款(us-central1)]:部署错误。加载用户代码时函数失败。这可能是由于用户代码中的错误造成的。错误消息:错误:请检

  • 假设我运行了一个带有ErrorAction Stop的命令,它生成了一个错误。我想知道错误最初是否终止?我有ErrorVariable或$Error对象。ErrorVariable能捕捉两种错误吗?我正在寻找一处房产。NET/PowerShell对象,它可以告诉我这个错误正在终止。非终止错误也会产生异常吗? 另外,当我在控制台上写一个命令时(不是ISE也没有运行脚本,只是在控制台上写一个命令),我

  • 我在部署从WebSphere迁移到JBoss6.1的proyect时遇到了一些问题 我在服务器上使用的Java jdk和ide是1.8.0_144,项目是用Java1.6编译的。一些服务器日志是: 我是一个相当的新手,所以如果需要更多的信息,我会提供它。 多谢.

  • 我使用的是Tomcat7.0.20和Grails1.3.7,在部署war文件时,我遇到了这个错误。 AM org.apache.Catalina.startup.hostconfig deployWAR信息:部署web应用程序存档ih-core.war 2013年2月25日1:55:35AM org.apache.Catalina.core.containerbase AddChildinal严重

  • 我正在使用ant脚本构建应用程序。此应用程序在9.2 bea下工作。lib=C:/bea92/weblogic92/server/lib-ant-code-工作正常,但当我切换到12c lib文件夹时。lib=C:/bea12c/wlserver\u 12.1/server/lib,它给了我这个错误: