0

我使用 Wildfly Swarm 生成器创建了一个演示应用程序,我想在其上添加 MicroProfile Rest Client。

我刚刚添加了依赖项:

<dependency>
  <groupId>org.wildfly.swarm</groupId>
  <artifactId>microprofile-restclient</artifactId>
</dependency>

并调用 RestClient 实例化代码:

UserService userService = RestClientBuilder.newBuilder().baseUrl(apiUri)
                                .build(UserService.class);

即使我不添加上面的行,只添加依赖项,我的应用程序也会出现依赖项错误。如果我执行mvn wildfly-swarm:run

java.lang.RuntimeException: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
    at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigProviderResolver: Provider org.wildfly.microprofile.config.WildFlyConfigProviderResolver not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:145)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.instance(ConfigProviderResolver.java:119)
    at org.eclipse.microprofile.config.ConfigProvider.<clinit>(ConfigProvider.java:74)
    at org.wildfly.microprofile.config.inject.ConfigExtension.validate(ConfigExtension.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 28 more

    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:45)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
    at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigProviderResolver: Provider org.wildfly.microprofile.config.WildFlyConfigProviderResolver not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:145)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.instance(ConfigProviderResolver.java:119)
    at org.eclipse.microprofile.config.ConfigProvider.<clinit>(ConfigProvider.java:74)
    at org.wildfly.microprofile.config.inject.ConfigExtension.validate(ConfigExtension.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 28 more

    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:37)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    ... 9 more
java.lang.RuntimeException: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
    at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigProviderResolver: Provider org.wildfly.microprofile.config.WildFlyConfigProviderResolver not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:145)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.instance(ConfigProviderResolver.java:119)
    at org.eclipse.microprofile.config.ConfigProvider.<clinit>(ConfigProvider.java:74)
    at org.wildfly.microprofile.config.inject.ConfigExtension.validate(ConfigExtension.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 28 more

    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:45)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: org.jboss.weld.exceptions.DeploymentException: Exception List with 1 exceptions:
Exception 0 :
javax.enterprise.event.ObserverException
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at java.lang.Class.newInstance(Class.java:442)
    at org.jboss.weld.security.NewInstanceAction.run(NewInstanceAction.java:33)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:40)
    at org.jboss.weld.injection.Exceptions.rethrowException(Exceptions.java:78)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:96)
    at org.jboss.weld.injection.MethodInvocationStrategy$SpecialParamPlusBeanManagerStrategy.invoke(MethodInvocationStrategy.java:144)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:299)
    at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:124)
    at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:277)
    at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:255)
    at org.jboss.weld.event.ObserverNotifier.notifySyncObservers(ObserverNotifier.java:269)
    at org.jboss.weld.event.ObserverNotifier.notify(ObserverNotifier.java:258)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:154)
    at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:148)
    at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:53)
    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:35)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.bootstrap(ServerBootstrapImpl.java:113)
    at org.wildfly.swarm.Swarm.start(Swarm.java:398)
    at org.wildfly.swarm.Swarm.main(Swarm.java:742)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.wildfly.swarm.bootstrap.MainInvoker.invoke(MainInvoker.java:53)
    at org.wildfly.swarm.bootstrap.MainInvoker.main(MainInvoker.java:106)
Caused by: java.util.ServiceConfigurationError: org.eclipse.microprofile.config.spi.ConfigProviderResolver: Provider org.wildfly.microprofile.config.WildFlyConfigProviderResolver not a subtype
    at java.util.ServiceLoader.fail(ServiceLoader.java:239)
    at java.util.ServiceLoader.access$300(ServiceLoader.java:185)
    at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:376)
    at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
    at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:145)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.loadSpi(ConfigProviderResolver.java:140)
    at org.eclipse.microprofile.config.spi.ConfigProviderResolver.instance(ConfigProviderResolver.java:119)
    at org.eclipse.microprofile.config.ConfigProvider.<clinit>(ConfigProvider.java:74)
    at org.wildfly.microprofile.config.inject.ConfigExtension.validate(ConfigExtension.java:103)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.weld.injection.StaticMethodInjectionPoint.invoke(StaticMethodInjectionPoint.java:88)
    ... 28 more

    at org.jboss.weld.bootstrap.events.AbstractDeploymentContainerEvent.fire(AbstractDeploymentContainerEvent.java:37)
    at org.jboss.weld.bootstrap.events.AfterDeploymentValidationImpl.fire(AfterDeploymentValidationImpl.java:28)
    at org.jboss.weld.bootstrap.WeldStartup.validateBeans(WeldStartup.java:482)
    at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:90)
    at org.jboss.weld.environment.se.Weld.initialize(Weld.java:767)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$null$0(ServerBootstrapImpl.java:149)
    at org.wildfly.swarm.container.runtime.LogSilencer$SilentExecutor.execute(LogSilencer.java:75)
    at org.wildfly.swarm.container.runtime.ServerBootstrapImpl.lambda$bootstrap$1(ServerBootstrapImpl.java:120)
    at org.wildfly.swarm.spi.api.ClassLoading.withTCCL(ClassLoading.java:43)
    ... 9 more

我想知道我是否忘记了一些依赖?或者我的代码有一些错误。

我的代码可以在这个存储库中找到。

我知道它不会正常工作,因为用户模型之间存在不一致。但它至少必须工作直到到达终点。

4

1 回答 1

2

不幸的是,mvn wildfly-swarm:run它的默认设置被严重破坏了,因为它没有构建一个 uberjar;相反,它从类路径运行应用程序。这是一个已知问题——如果我不是用手机写信,我会提供一个链接。

你可以试试跑步mvn wildfly-swarm:run -Dwildfly-swarm.useUberJar=true看看有没有帮助?

于 2018-06-20T19:42:06.760 回答