-
Notifications
You must be signed in to change notification settings - Fork 470
Reactive auto-configuration not working with Spring Boot 2.2.0 M3 #995
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you clarify whether you have seen this working before? Given the arrangement in Spring Boot's auto-configuration, it looks like nothing in particular has changed for this release. I.e. I am suspecting that some parts of the auto-configuration have always triggered inclusion of configuration that somehow triggers Servlet stuff. Here's a few things I found out during first level debugging:
It looks like this will need a bit more refactoring on the Boot side. I'll ping the team and consult them for how to proceed. |
I actually tried this the first time with current Spring Boot 2.2.0 milestone 3, so I cannot tell if it was broken before
That's what I also tried to exclude the servlet web starter dependency then I also got the same error.
Thanks very much :-) |
It looks like it hasn't ever worked before. I could get a sample project to bootstrap by explicitly disabling the hypermedia auto-configuration and activating Spring HATEOAS manually:
There already is a ticket at spring-projects/spring-boot#16020, so I'll close this one in favor of the other. |
Using Spring HATEOAS 1.0.0 M2 together with Spring Boot 2.2.0 M3 in reactive web mode is not working.
Steps to reproduce this issue:
Then the spring application always starts using Tomcat in Servlet mode.
According to debug mode output the autoconfiguration does not detect a reactive web application:
WebFluxAutoConfiguration:
Did not match:
- not a reactive web application (OnWebApplicationCondition)
Matched:
- @ConditionalOnClass found required class 'org.springframework.web.reactive.config.WebFluxConfigurer' (OnClassCondition)
I tried adding '@EnableWebFlux' annotation, but then another error pops up:
The bean 'requestMappingHandlerAdapter', defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration
$EnableWebMvcConfiguration.class], could not be registered. A bean with that name has already been defined in class path resource [org/springframework/web/reactive/config/DelegatingWebFluxConfiguration.class] and overriding is disabled.
It seems that the Spring HATEOAS dependency always forces a servlet based auto configuration via '@import(HypermediaHttpMessageConverterConfiguration.class)' in class org.springframework.boot.autoconfigure.hateoas.HypermediaAutoConfiguration
If I remove the Spring HATEOAS dependency in gradle/maven build file then application starts in reactive mode using netty again as expected.
The text was updated successfully, but these errors were encountered: