我想将 spring-boot 2.2.2.RELEASE 应用程序部署到 Wildfly 18 应用程序服务器上。
pom.xml:
<dependencies>
<dependency>
<groupId>io.ropi.psf</groupId>
<artifactId>psf-api</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
<artifactId>mapstruct-processor</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j18-impl</artifactId>
</dependency>
</dependencies>
当我尝试部署它时,我收到以下错误:
2020-03-14 23:40:01,657 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-4) MSC000001: Failed to start service jboss.deployment.unit."psf-frontend-1.0-SNAPSHOT.war".component."org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener".WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.unit."psf-frontend-1.0-SNAPSHOT.war".component."org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener".WeldInstantiator: Failed to start service
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1731)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
at org.jboss.threads@2.3.3.Final//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1363)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.jboss.weld.resources.spi.ResourceLoadingException: Error while loading class org.springframework.http.server.reactive.ServletHttpHandlerAdapter$HandlerResultAsyncListener
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer.getEnhancedAnnotatedType(ClassTransformer.java:232)
at org.jboss.as.weld@18.0.1.Final//org.jboss.as.weld.injection.InjectionTargets.createInjectionTarget(InjectionTargets.java:64)
at org.jboss.as.weld@18.0.1.Final//org.jboss.as.weld.injection.WeldComponentService.start(WeldComponentService.java:121)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
at org.jboss.msc@1.4.11.Final//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
... 6 more
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletHttpHandlerAdapter$HandlerResultSubscriber (Module "deployment.psf-frontend-1.0-SNAPSHOT.war" from Service Module Loader): org/reactivestreams/Subscriber
at java.base/java.lang.ClassLoader.defineClass1(Native Method)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1095)
at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:424)
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.base/java.lang.Class.getDeclaringClass0(Native Method)
at java.base/java.lang.Class.getDeclaringClass(Class.java:1471)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.reflection.Reflections.checkDeclaringClassLoadable(Reflections.java:427)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:83)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:79)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$null$0(ReentrantMapBackedComputingCache.java:55)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.WeakLazyValueHolder$1.computeValue(WeakLazyValueHolder.java:35)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.WeakLazyValueHolder.get(WeakLazyValueHolder.java:53)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:72)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:78)
at org.jboss.weld.core@3.1.2.Final//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:177)
... 12 more
可以通过包括以下内容来解决此问题:
<dependency>
<groupId>org.reactivestreams</groupId>
<artifactId>reactive-streams</artifactId>
</dependency>
我真的不想这样做,因为我没有制作反应式网络应用程序。这个问题有更好的解决方法/解决方案吗?或者它是一个错误?