Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update to Spring 5.1 - java.lang.NoClassDefFoundError: org/springframework/http/server/reactive/ServletServerHttpResponse$ResponseBodyProcessor

I get the following stacktrace while deploying when trying to update to Spring 5.1 from 4.3. Server is WildFly 14. Runtime is JDK 11. Compiler target is 1.8.

I tried cleaning dependecies, but nothing help. Further below is dependency:tree output.

22:23:51,323 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."BDOS-POP.war".component."org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener".WeldInstantiator: org.jboss.msc.service.StartException in service jboss.deployment.unit."BDOS-POP.war".component."org.springframework.http.server.reactive.ServletServerHttpResponse$ResponseAsyncListener".WeldInstantiator: Failed to start service
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1728)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
    at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1364)
    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.ServletServerHttpResponse$ResponseAsyncListener
    at [email protected]//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:186)
    at [email protected]//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:194)
    at [email protected]//org.jboss.weld.resources.ClassTransformer.getEnhancedAnnotatedType(ClassTransformer.java:232)
    at [email protected]//org.jboss.as.weld.injection.InjectionTargets.createInjectionTarget(InjectionTargets.java:60)
    at [email protected]//org.jboss.as.weld.injection.WeldComponentService.start(WeldComponentService.java:120)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
    ... 6 more
Caused by: java.lang.NoClassDefFoundError: Failed to link org/springframework/http/server/reactive/ServletServerHttpResponse$ResponseBodyProcessor (Module "deployment.BDOS-POP.war" from Service Module Loader): Failed to link org/springframework/http/server/reactive/AbstractListenerWriteProcessor (Module "deployment.BDOS-POP.war" from Service Module Loader): org/reactivestreams/Processor
    at java.base/java.lang.Class.getDeclaringClass0(Native Method)
    at java.base/java.lang.Class.getDeclaringClass(Class.java:1472)
    at [email protected]//org.jboss.weld.util.reflection.Reflections.checkDeclaringClassLoadable(Reflections.java:427)
    at [email protected]//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:83)
    at [email protected]//org.jboss.weld.resources.ClassTransformer$TransformClassToBackedAnnotatedType.apply(ClassTransformer.java:79)
    at [email protected]//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.lambda$null$0(ReentrantMapBackedComputingCache.java:55)
    at [email protected]//org.jboss.weld.util.WeakLazyValueHolder$1.computeValue(WeakLazyValueHolder.java:35)
    at [email protected]//org.jboss.weld.util.WeakLazyValueHolder.get(WeakLazyValueHolder.java:53)
    at [email protected]//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getValue(ReentrantMapBackedComputingCache.java:72)
    at [email protected]//org.jboss.weld.util.cache.ReentrantMapBackedComputingCache.getCastValue(ReentrantMapBackedComputingCache.java:78)
    at [email protected]//org.jboss.weld.resources.ClassTransformer.getBackedAnnotatedType(ClassTransformer.java:177)
    ... 12 more

mvn dependency:tree looks like this:

[INFO] com.company:app:war:1.0-SNAPSHOT
[INFO] +- org.apache.wicket:wicket-core:jar:7.10.0:compile
[INFO] |  +- org.apache.commons:commons-collections4:jar:4.1:compile
[INFO] |  +- org.apache.wicket:wicket-request:jar:7.10.0:compile
[INFO] |  +- org.apache.wicket:wicket-util:jar:7.10.0:compile
[INFO] |  |  \- commons-fileupload:commons-fileupload:jar:1.3.2:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.21:compile
[INFO] +- org.apache.wicket:wicket-extensions:jar:7.10.0:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.7.25:compile
[INFO] +- log4j:log4j:jar:1.2.17:compile
[INFO] +- org.springframework:spring-core:jar:5.1.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-jcl:jar:5.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:5.1.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-beans:jar:5.1.0.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:5.1.0.RELEASE:compile
[INFO] |  +- org.springframework:spring-aop:jar:5.1.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:5.1.0.RELEASE:compile
[INFO] +- org.apache.wicket:wicket-spring:jar:7.10.0:compile
[INFO] |  \- org.apache.wicket:wicket-ioc:jar:7.10.0:compile
[INFO] |     +- cglib:cglib:jar:3.1:compile
[INFO] |     +- javax.inject:javax.inject:jar:1:compile
[INFO] |     \- org.ow2.asm:asm-util:jar:5.0.3:compile
[INFO] |        \- org.ow2.asm:asm-tree:jar:5.0.3:compile
[INFO] |           \- org.ow2.asm:asm:jar:5.0.3:compile
[INFO] +- org.apache.wicket:wicket-devutils:jar:7.10.0:compile
[INFO] +- org.springframework:spring-jdbc:jar:5.1.0.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:5.1.0.RELEASE:compile
[INFO] +- org.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec:jar:1.0.0.Final:compile
[INFO] +- com.zaxxer:HikariCP:jar:3.2.0:compile
[INFO] +- org.apache.commons:commons-lang3:jar:3.8:compile
[INFO] +- com.company:wicketWebComponents:jar:2.0.0-SNAPSHOT:compile
[INFO] |  \- org.apache.commons:commons-vfs2:jar:2.1:compile
[INFO] |     \- commons-logging:commons-logging:jar:1.2:compile
[INFO] +- com.company.marsz:MailSender:jar:1.8.1:compile
[INFO] |  \- org.apache.commons:commons-email:jar:1.4:compile
[INFO] |     +- com.sun.mail:javax.mail:jar:1.5.2:compile
[INFO] |     \- javax.activation:activation:jar:1.1.1:compile
[INFO] +- net.bull.javamelody:javamelody-core:jar:1.74.0:compile
[INFO] |  \- org.jrobin:jrobin:jar:1.5.9:compile
[INFO] +- com.company.proces:system-parameters:jar:1.8.6-SNAPSHOT:compile
[INFO] |  +- redis.clients:jedis:jar:2.9.0:compile
[INFO] |  |  \- org.apache.commons:commons-pool2:jar:2.4.2:compile
[INFO] |  +- org.springframework.data:spring-data-redis:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-keyvalue:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-oxm:jar:5.1.0.RELEASE:compile
[INFO] |  |  \- org.springframework:spring-context-support:jar:5.1.0.RELEASE:compile
[INFO] |  +- com.company:energetyka-coretypes:jar:1.8.1-umarsz:compile
[INFO] |  \- com.company:ucore:jar:1.8.6-SNAPSHOT:compile
[INFO] +- com.company:sso-service:jar:1.8.0:compile
[INFO] |  \- org.jasig.cas.client:cas-client-core:jar:3.4.1:compile
[INFO] +- com.company:appBackend:jar:1.0-SNAPSHOT:compile
[INFO] |  +- org.springframework.data:spring-data-jpa:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework.data:spring-data-commons:jar:2.1.0.RELEASE:compile
[INFO] |  |  +- org.springframework:spring-orm:jar:5.1.0.RELEASE:compile
[INFO] |  |  \- org.aspectj:aspectjrt:jar:1.9.1:compile
[INFO] |  +- javax.xml.bind:jaxb-api:jar:2.3.0:compile
[INFO] |  +- com.sun.xml.bind:jaxb-core:jar:2.3.0:compile
[INFO] |  +- com.sun.xml.bind:jaxb-impl:jar:2.3.0:compile
[INFO] |  +- javax.annotation:javax.annotation-api:jar:1.3.1:compile
[INFO] |  \- javax.persistence:javax.persistence-api:jar:2.2:compile
[INFO] +- com.fasterxml.jackson.core:jackson-databind:jar:2.9.5:compile
[INFO] |  +- com.fasterxml.jackson.core:jackson-annotations:jar:2.9.0:compile
[INFO] |  \- com.fasterxml.jackson.core:jackson-core:jar:2.9.5:compile
[INFO] +- com.company:notification-api:jar:0.0.1-SNAPSHOT:compile
[INFO] |  +- com.google.code.gson:gson:jar:2.6.2:compile
[INFO] |  \- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] +- com.company:c-components:jar:1.1.1-SNAPSHOT:compile
[INFO] +- com.company.marsz:wicketWebComponents:jar:1.8-SNAPSHOT:compile
[INFO] +- com.company.marsz:ExcelReports:jar:1.8.1:compile
[INFO] |  +- com.company.marsz:statistics:jar:1.8.1:compile
[INFO] |  +- commons-io:commons-io:jar:2.6:compile
[INFO] |  +- commons-codec:commons-codec:jar:1.11:compile
[INFO] |  +- org.apache.poi:poi:jar:4.0.0:compile
[INFO] |  +- org.apache.poi:poi-ooxml:jar:4.0.0:compile
[INFO] |  |  +- org.apache.poi:poi-ooxml-schemas:jar:4.0.0:compile
[INFO] |  |  |  \- org.apache.xmlbeans:xmlbeans:jar:3.0.1:compile
[INFO] |  |  +- org.apache.commons:commons-compress:jar:1.18:compile
[INFO] |  |  \- com.github.virtuald:curvesapi:jar:1.04:compile
[INFO] |  \- xerces:xercesImpl:jar:2.12.0:compile
[INFO] |     \- xml-apis:xml-apis:jar:1.4.01:compile
[INFO] +- org.hibernate:hibernate-core:jar:5.3.6.Final:provided
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.3.2.Final:provided
[INFO] |  +- org.javassist:javassist:jar:3.23.1-GA:provided
[INFO] |  +- net.bytebuddy:byte-buddy:jar:1.8.17:provided
[INFO] |  +- antlr:antlr:jar:2.7.7:provided
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.1.1.Final:provided
[INFO] |  +- org.jboss:jandex:jar:2.0.5.Final:provided
[INFO] |  +- com.fasterxml:classmate:jar:1.3.4:provided
[INFO] |  +- javax.activation:javax.activation-api:jar:1.2.0:provided
[INFO] |  +- dom4j:dom4j:jar:1.6.1:provided
[INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:5.0.4.Final:provided
[INFO] \- com.company:multitenancy:jar:1.0.0-SNAPSHOT:compile
like image 427
Robert Niestroj Avatar asked Oct 08 '18 20:10

Robert Niestroj


1 Answers

I found help on the wildfly forums: https://developer.jboss.org/thread/276373?start=15&tstart=0

After adding this dependency it works:

<dependency>
   <groupId>org.reactivestreams</groupId>
   <artifactId>reactive-streams</artifactId>
   <version>1.0.1</version>
</dependency>
like image 106
Robert Niestroj Avatar answered Oct 30 '22 17:10

Robert Niestroj