Wildfly deploy error: WFLYCTL0062: Composite operation failed and was rolled back. ConfigSource: ServletConfigSource not a subtype

Wildfly deploy error: WFLYCTL0062: Composite operation failed and was rolled back. ConfigSource: ServletConfigSource not a subtype

我有一个使用 Maven 编译的 Java 应用程序(mvn -U clean package 什么的),我使用 jboss-cli.sh:

手动部署它
$ /usr/local/wildfly-23.0.2.Final/bin/jboss-cli.sh --connect --controller=localhost:9991 --command='deploy /usr/local/git/app/war-module/target/war-module.war --force'

直到上周它才开始显示此错误:

[standalone@localhost:9991 /] deploy /usr/local/git/app/war-module/target/war-module.war --force
{"WFLYCTL0062: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"war-module.war\".WeldStartService" => "Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException
    Caused by: javax.enterprise.event.ObserverException
    Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSource: org.jboss.resteasy.microprofile.config.ServletConfigSource not a subtype"}}}}

查看控制台日志输出,我发现了这些行:

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC000001: Failed to start service jboss.deployment.unit."war-module.war".WeldStartService: org.jboss.msc.service.StartException in service jboss.deployment.unit."war-module.war".WeldStartService: Failed to start service
        at org.jboss.msc@1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
        at org.jboss.msc@1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1990)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
        at org.jboss.threads@2.4.0.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
        at java.base/java.lang.Thread.run(Thread.java:832)
Caused by: org.jboss.weld.exceptions.DeploymentException
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:38)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:505)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:93)
        at org.jboss.as.weld@23.0.2.Final//org.jboss.as.weld.WeldStartService.start(WeldStartService.java:98)
        at org.jboss.msc@1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
        at org.jboss.msc@1.4.12.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
        ... 6 more
Caused by: javax.enterprise.event.ObserverException
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
        at java.base/java.lang.reflect.ReflectAccess.newInstance(ReflectAccess.java:124)
        at java.base/jdk.internal.reflect.ReflectionFactory.newInstance(ReflectionFactory.java:346)
        at java.base/java.lang.Class.newInstance(Class.java:604)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:103)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:85)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.MethodInvocationStrategy$SimpleMethodInvocationStrategy.invoke(MethodInvocationStrategy.java:168)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:330)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:123)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:308)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:286)
        at javax.enterprise.api//javax.enterprise.inject.spi.ObserverMethod.notify(ObserverMethod.java:124)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.util.Observers.notify(Observers.java:166)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:285)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:273)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:177)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:171)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
        ... 12 more
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSource: org.jboss.resteasy.microprofile.config.ServletConfigSource not a subtype
        at java.base/java.util.ServiceLoader.fail(ServiceLoader.java:591)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNextService(ServiceLoader.java:1238)
        at java.base/java.util.ServiceLoader$LazyClassPathLookupIterator.hasNext(ServiceLoader.java:1266)
        at java.base/java.util.ServiceLoader.hasNext(ServiceLoader.java:1301)
        at java.base/java.util.ServiceLoader.hasNext(ServiceLoader.java:1386)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfigBuilder.discoverSources(SmallRyeConfigBuilder.java:96)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfig$ConfigSources.buildConfigSources(SmallRyeConfig.java:564)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfig$ConfigSources.<init>(SmallRyeConfig.java:517)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfig.<init>(SmallRyeConfig.java:68)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfigBuilder.build(SmallRyeConfigBuilder.java:418)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfigFactory$Default.getConfigFor(SmallRyeConfigFactory.java:59)
        at deployment.war-module.war//io.smallrye.config.SmallRyeConfigProviderResolver.getConfig(SmallRyeConfigProviderResolver.java:76)
        at deployment.war-module.war//org.eclipse.microprofile.config.ConfigProvider.getConfig(ConfigProvider.java:101)
        at deployment.war-module.war//io.smallrye.config.inject.ConfigExtension.validate(ConfigExtension.java:147)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:564)
        at org.jboss.weld.core@3.1.6.Final//org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:95)
        ... 26 more

11:33:02,318 ERROR [org.jboss.as.controller.management-operation] (management-handler-thread - 1) WFLYCTL0013: Operation ("deploy") failed - address: ({"deployment" => "war-module.war"}) - failure description: {"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"war-module.war\".WeldStartService" => "Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException
    Caused by: javax.enterprise.event.ObserverException
    Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSource: org.jboss.resteasy.microprofile.config.ServletConfigSource not a subtype"}}
11:33:02,319 ERROR [org.jboss.as.server] (management-handler-thread - 1) WFLYSRV0021: Deploy of deployment "war-module.war" was rolled back with the following failure message: 
{"WFLYCTL0080: Failed services" => {"jboss.deployment.unit.\"war-module.war\".WeldStartService" => "Failed to start service
    Caused by: org.jboss.weld.exceptions.DeploymentException
    Caused by: javax.enterprise.event.ObserverException
    Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigSource: org.jboss.resteasy.microprofile.config.ServletConfigSource not a subtype"}}

Wildfly 版本 23.0.2,OpenJDK 14,在 Maven 的 pom.xml 中使用 maven-compiler-plugin v3.8.1 定位 Java 11。

已经尝试取消部署所有内容并在没有 --force 的情况下再次部署 war,但没有成功。

升级到 Wildfly 26.0.1 解决了这个问题。

结果我试图在 Wildfly 23 中部署,但该应用程序已被其他团队升级到 Wildfly 26:他们将 Maven 包 org.wildfly.bom:wildfly-jakartaee8 更改为版本 26.0.1.Final

可能与 Wildfly 中 MicroProfile 添加的新功能有关 24, 25 or 26