With a simple project using
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.0.RELEASE</version>
</parent>
and dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
then it's not possible to boot the app.
The reactor-netty transitive dependency is 0.9.3.RELEASE
which does not have HttpService.channelGroup()
method still called in NettyWebService
class.
It fails with
***************************
APPLICATION FAILED TO START
***************************
Description:
An attempt was made to call a method that does not exist. The attempt was made from the following location:
org.springframework.boot.web.embedded.netty.NettyWebServer.<init>(NettyWebServer.java:86)
The following method did not exist:
reactor.netty.http.server.HttpServer.channelGroup(Lio/netty/channel/group/ChannelGroup;)Lreactor/netty/http/server/HttpServer;
The method's class, reactor.netty.http.server.HttpServer, is available from the following locations:
jar:file:/C:/maven/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.3.RELEASE/reactor-netty-0.9.3.RELEASE.jar!/reactor/netty/http/server/HttpServer.class
It was loaded from the following location:
file:/C:/maven/.m2/repository/io/projectreactor/netty/reactor-netty/0.9.3.RELEASE/reactor-netty-0.9.3.RELEASE.jar
Action:
Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.http.server.HttpServer
Comment From: wilkinsona
The dependency management in Spring Boot 2.3.0 uses Reactor Netty 0.9.7.RELEASE by default. You can see this from a project generated on start.spring.io:
[INFO] com.example:gh-21506:jar:0.0.1-SNAPSHOT
[INFO] +- org.springframework.boot:spring-boot-starter-webflux:jar:2.3.0.RELEASE:compile
[INFO] | +- org.springframework.boot:spring-boot-starter:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot:jar:2.3.0.RELEASE:compile
[INFO] | | | \- org.springframework:spring-context:jar:5.2.6.RELEASE:compile
[INFO] | | | +- org.springframework:spring-aop:jar:5.2.6.RELEASE:compile
[INFO] | | | \- org.springframework:spring-expression:jar:5.2.6.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-autoconfigure:jar:2.3.0.RELEASE:compile
[INFO] | | +- org.springframework.boot:spring-boot-starter-logging:jar:2.3.0.RELEASE:compile
[INFO] | | | +- ch.qos.logback:logback-classic:jar:1.2.3:compile
[INFO] | | | | \- ch.qos.logback:logback-core:jar:1.2.3:compile
[INFO] | | | +- org.apache.logging.log4j:log4j-to-slf4j:jar:2.13.2:compile
[INFO] | | | | \- org.apache.logging.log4j:log4j-api:jar:2.13.2:compile
[INFO] | | | \- org.slf4j:jul-to-slf4j:jar:1.7.30:compile
[INFO] | | +- jakarta.annotation:jakarta.annotation-api:jar:1.3.5:compile
[INFO] | | \- org.yaml:snakeyaml:jar:1.26:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-json:jar:2.3.0.RELEASE:compile
[INFO] | | +- com.fasterxml.jackson.core:jackson-databind:jar:2.11.0:compile
[INFO] | | | +- com.fasterxml.jackson.core:jackson-annotations:jar:2.11.0:compile
[INFO] | | | \- com.fasterxml.jackson.core:jackson-core:jar:2.11.0:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jdk8:jar:2.11.0:compile
[INFO] | | +- com.fasterxml.jackson.datatype:jackson-datatype-jsr310:jar:2.11.0:compile
[INFO] | | \- com.fasterxml.jackson.module:jackson-module-parameter-names:jar:2.11.0:compile
[INFO] | +- org.springframework.boot:spring-boot-starter-reactor-netty:jar:2.3.0.RELEASE:compile
[INFO] | | \- io.projectreactor.netty:reactor-netty:jar:0.9.7.RELEASE:compile
There must be an override of the Reactor Netty version somewhere in your build configuration.
Comment From: P3tronius
That's what i've seen while using spring https://start.spring.io/, sorry for the noise.
edit:
I had to add the reactor-bom
in version Dysprosium-SR7
to get the correct version of reactor-netty
, even though nowhere I override any version of any dependency. Still seems to me there is something strange going on.