Не удается развернуть файл ear в Wildfly (используя Myfaces) - PullRequest
0 голосов
/ 09 октября 2019

Я пытаюсь развернуть ухо со встроенной войной на Wildfly 17. Если я разверну войну, она заработает, ухо выйдет из строя с некоторыми ошибками (см. Ниже). Я использую Myfaces 2.3.4 и установил его как модуль, выполнив шаги здесь (jsf: list-active-jsf-impls () возвращает правильную реализацию jsf).

    [...]
2019-10-09 09:17:15.491 WARN  [org.jboss.weld.Bootstrap] (MSC service thread 1-4) WELD-000146: BeforeBeanDiscovery.addAnnotatedType(AnnotatedType<?>) used for class com.sun.faces.flow.FlowDiscoveryCDIHelper is deprecated from CDI 1.1!
2019-10-09 09:17:16.103 SEVERE [javax.enterprise.resource.webcontainer.jsf.flow] (MSC service thread 1-4) Unable to obtain CDI 1.1 utilities for Mojarra
2019-10-09 09:17:16.106 SEVERE [javax.enterprise.resource.webcontainer.jsf.application.view] (MSC service thread 1-4) Unable to obtain CDI 1.1 utilities for Mojarra
2019-10-09 09:17:16.465 INFO  [org.apache.myfaces.ee.MyFacesContainerInitializer] (ServerService Thread Pool -- 93) Using org.apache.myfaces.ee.MyFacesContainerInitializer
2019-10-09 09:17:16.469 INFO  [org.apache.myfaces.ee.MyFacesContainerInitializer] (ServerService Thread Pool -- 93) Using org.apache.myfaces.ee.MyFacesContainerInitializer
2019-10-09 09:17:16.507 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 93) 1 Spring WebApplicationInitializers detected on classpath

2019-10-09 09:17:17.988 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 93) Reading standard config META-INF/standard-faces-config.xml
2019-10-09 09:17:18.144 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 93) Reading config /WEB-INF/faces-config.xml
2019-10-09 09:17:18.163 WARN  [org.jboss.modules.define] (ServerService Thread Pool -- 93) Failed to define class org.jboss.as.jsf.injection.MyFacesAnnotationProvider in Module "org.jboss.as.jsf-injection" from local module loader @5bcab519 (finder: local module finder @e45f292 (roots: E:\wildfly-17.0.1.Final\modules,E:\wildfly-17.0.1.Final\modules\system\layers\base)): java.lang.NoClassDefFoundError: Failed to link org/jboss/as/jsf/injection/MyFacesAnnotationProvider (Module "org.jboss.as.jsf-injection" from local module loader @5bcab519 (finder: local module finder @e45f292 (roots: E:\wildfly-17.0.1.Final\modules,E:\wildfly-17.0.1.Final\modules\system\layers\base))): org/apache/myfaces/spi/AnnotationProvider
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
    at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:423)
    at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:555)
    at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:339)
    at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:126)
    at org.jboss.modules.Module.loadModuleClass(Module.java:731)
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:247)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
    at java.lang.Class.forName0(Native Method)
    at java.lang.Class.forName(Class.java:348)
    at org.apache.myfaces.shared.util.ClassUtils.classForName(ClassUtils.java:184)
    at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:224)
    at org.apache.myfaces.shared.util.ClassUtils.simpleClassForName(ClassUtils.java:207)
    at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:562)
    at org.apache.myfaces.shared.util.ClassUtils.buildApplicationObject(ClassUtils.java:534)
    at org.apache.myfaces.spi.impl.DefaultAnnotationProviderFactory.resolveAnnotationProviderFromService(DefaultAnnotationProviderFactory.java:138)
    at org.apache.myfaces.spi.impl.DefaultAnnotationProviderFactory.createAnnotationProvider(DefaultAnnotationProviderFactory.java:93)
    at org.apache.myfaces.spi.impl.DefaultAnnotationProviderFactory.getAnnotationProvider(DefaultAnnotationProviderFactory.java:62)
    at org.apache.myfaces.config.annotation.AnnotationConfigurator.createFacesConfig(AnnotationConfigurator.java:90)
    at org.apache.myfaces.config.DefaultFacesConfigurationProvider.getAnnotationsFacesConfig(DefaultFacesConfigurationProvider.java:201)
    at org.apache.myfaces.config.DefaultFacesConfigurationMerger.getFacesConfigData(DefaultFacesConfigurationMerger.java:92)
    at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:603)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:456)
    at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:70)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:190)
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:103)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$846/1759140372.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:485)

2019-10-09 09:17:18.164 SEVERE [org.apache.myfaces.webapp.AbstractFacesInitializer] (ServerService Thread Pool -- 93) An error occured while initializing MyFaces: null: java.lang.NullPointerException
    at org.apache.myfaces.config.annotation.AnnotationConfigurator.createFacesConfig(AnnotationConfigurator.java:91)
    at org.apache.myfaces.config.DefaultFacesConfigurationProvider.getAnnotationsFacesConfig(DefaultFacesConfigurationProvider.java:201)
    at org.apache.myfaces.config.DefaultFacesConfigurationMerger.getFacesConfigData(DefaultFacesConfigurationMerger.java:92)
    at org.apache.myfaces.config.FacesConfigurator.configure(FacesConfigurator.java:603)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:456)
    at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:70)
    at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:190)
    at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:103)
    at io.undertow.servlet.core.ApplicationListeners.contextInitialized(ApplicationListeners.java:187)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:216)
    at io.undertow.servlet.core.DeploymentManagerImpl$1.call(DeploymentManagerImpl.java:185)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$846/1759140372.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at io.undertow.servlet.core.DeploymentManagerImpl.deploy(DeploymentManagerImpl.java:250)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:96)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:485)

2019-10-09 09:17:18.165 INFO  [org.apache.myfaces.webapp.StartupServletContextListener] (ServerService Thread Pool -- 93) MyFaces Core has started, it took [254] ms.
2019-10-09 09:17:18.166 INFO  [io.undertow.servlet] (ServerService Thread Pool -- 93) Initializing Spring root WebApplicationContext
2019-10-09 09:17:18.167 INFO  [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 93) Root WebApplicationContext: initialization started
2019-10-09 09:17:18.913 INFO  [org.springframework.security.web.DefaultSecurityFilterChain] (ServerService Thread Pool -- 93) Creating filter chain: Ant [pattern='/javax.faces.resource/**'], []
2019-10-09 09:17:18.914 INFO  [org.springframework.security.web.DefaultSecurityFilterChain] (ServerService Thread Pool -- 93) Creating filter chain: Ant [pattern='/404.xhtml'], []
2019-10-09 09:17:18.918 INFO  [org.springframework.security.web.DefaultSecurityFilterChain] (ServerService Thread Pool -- 93) Creating filter chain: Ant [pattern='/403.xhtml'], []
2019-10-09 09:17:18.953 INFO  [org.springframework.security.web.DefaultSecurityFilterChain] (ServerService Thread Pool -- 93) Creating filter chain: any request, [...]
2019-10-09 09:17:18.994 INFO  [org.springframework.web.context.ContextLoader] (ServerService Thread Pool -- 93) Root WebApplicationContext initialized in 805 ms
2019-10-09 09:17:19.437 SEVERE [javax.faces] (ServerService Thread Pool -- 93) Unable to obtain InjectionProvider from init time FacesContext. Does this container implement the Mojarra Injection SPI?
2019-10-09 09:17:19.439 SEVERE [javax.faces] (ServerService Thread Pool -- 93) Application was not properly initialized at startup, could not find Factory: javax.faces.context.FacesContextFactory. Attempting to find backup.
2019-10-09 09:17:19.443 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 93) MSC000001: Failed to start service jboss.deployment.subunit."online.ear"."online.war".undertow-deployment: org.jboss.msc.service.StartException in service jboss.deployment.subunit."online.ear"."online.war".undertow-deployment: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:81)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.lang.Thread.run(Thread.java:745)
    at org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
    at javax.faces.FactoryFinderInstance.notNullFactory(FactoryFinderInstance.java:524)
    at javax.faces.FactoryFinderInstance.getFactory(FactoryFinderInstance.java:207)
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:279)
    at javax.faces.webapp.FacesServlet.acquireFacesContextFactory(FacesServlet.java:500)
    at javax.faces.webapp.FacesServlet.init(FacesServlet.java:340)
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:117)
    at org.wildfly.extension.undertow.security.RunAsLifecycleInterceptor.init(RunAsLifecycleInterceptor.java:78)
    at io.undertow.servlet.core.LifecyleInterceptorInvocation.proceed(LifecyleInterceptorInvocation.java:103)
    at io.undertow.servlet.core.ManagedServlet$DefaultInstanceStrategy.start(ManagedServlet.java:303)
    at io.undertow.servlet.core.ManagedServlet.createServlet(ManagedServlet.java:143)
    at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:583)
    at io.undertow.servlet.core.DeploymentManagerImpl$2.call(DeploymentManagerImpl.java:554)
    at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:42)
    at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction.lambda$create$0(SecurityContextThreadSetupAction.java:105)
    at org.wildfly.extension.undertow.security.SecurityContextThreadSetupAction$$Lambda$846/1759140372.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction.lambda$create$0(UndertowDeploymentInfoService.java:1502)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentInfoService$UndertowThreadSetupAction$$Lambda$847/663608927.call(Unknown Source)
    at io.undertow.servlet.core.DeploymentManagerImpl.start(DeploymentManagerImpl.java:596)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService.startContext(UndertowDeploymentService.java:97)
    at org.wildfly.extension.undertow.deployment.UndertowDeploymentService$1.run(UndertowDeploymentService.java:78)
    ... 8 more

2019-10-09 09:17:19.449 ERROR [org.jboss.as.controller.management-operation] (Controller Boot Thread) WFLYCTL0013: Operation ("deploy") failed - address: ([("deployment" => "online.ear")]) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.subunit.\"online.ear\".\"online.war\".undertow-deployment" => "java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
    Caused by: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. "}}
2019-10-09 09:17:19.521 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 47) WFLYSRV0010: Deployed "standard-ds.xml" (runtime-name : "standard-ds.xml")
2019-10-09 09:17:19.521 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 47) WFLYSRV0010: Deployed "online.ear" (runtime-name : "online.ear")
2019-10-09 09:17:19.527 INFO  [org.jboss.as.controller] (Controller Boot Thread) WFLYCTL0183: Service status report
WFLYCTL0186:   Services which failed to start:      service jboss.deployment.subunit."online.ear"."online.war".undertow-deployment: java.lang.IllegalStateException: Could not find backup for factory javax.faces.context.FacesContextFactory. 
WFLYCTL0448: 2 additional services are down due to their dependencies being missing or failed
2019-10-09 09:17:19.581 INFO  [org.jboss.as.server] (Controller Boot Thread) WFLYSRV0212: Resuming server
2019-10-09 09:17:19.584 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0060: Http management interface listening on http://127.0.0.1:9990/management
2019-10-09 09:17:19.652 INFO  [org.jboss.as] (Controller Boot Thread) WFLYSRV0051: Admin console listening on http://127.0.0.1:9990
2019-10-09 09:17:19.653 ERROR [org.jboss.as] (Controller Boot Thread) WFLYSRV0026: WildFly Full 17.0.1.Final (WildFly Core 9.0.2.Final) started (with errors) in 28968ms - Started 3094 of 3324 services (5 services failed or missing dependencies, 409 services are lazy, passive or on-demand)

Я удивлен, прочитав "Мохарру" пару раз.

Мой jboss-deploy-structure.xml

<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.1">
  <deployment>
    <dependencies>
    <module name="org.jboss.remote-naming" export="true" />

    <module name="org.infinispan.core" slot="ispn-9.2" services="export" export="true"/>
    <module name="org.infinispan.commons" slot="ispn-9.2" services="export" export="true"/>
    <module name="org.infinispan" slot="ispn-9.2" services="export" export="true"/>

    <module name="org.jboss.xnio" export="true" />
    <module name="org.jboss.remoting3" export="true" />
    <module name="org.apache.cxf"/>
        <module name="org.apache.cxf.impl"/>
    </dependencies>
    <!--
        <exclusions>  
            <module name="javax.faces.api" slot="main" />  
            <module name="com.sun.jsf-impl" slot="main" />  
            <module name="org.jboss.as.jsf-injection" slot="main" />  
        </exclusions> 
        -->
  </deployment>
</jboss-deployment-structure>

Wildfly 17;Myfaces 2.3.4 (JSF 2.3)

...