Closed
Description
Describe the bug
If your java/kotlin application uses a combination of springdoc-openapi-webflux-ui v1.6.7 + spring actuator + spring cloud stream - it crashes on startup with the message:
***************************
APPLICATION FAILED TO START
***************************
Description:
Parameter 0 of method webConversionServiceProvider in org.springdoc.core.SpringDocConfiguration$WebConversionServiceConfiguration required a single bean, but 2 were found:
- webFluxConversionService: defined by method 'webFluxConversionService' in class path resource [org/springframework/boot/autoconfigure/web/reactive/WebFluxAutoConfiguration$EnableWebFluxConfiguration.class]
- integrationConversionService: defined in null
To Reproduce
Steps to reproduce the behavior:
- Create a new spring boot application at the spring initializr. Add the following dependencies:
- "Spring Boot Actuator"
- "Cloud Stream"
- "Spring Reactive Web"
- Programming language doesn't matter (I reproduced the bug with Java and Kotlin).
- Download and unpack the archive.
- Add the swagger into
build.gradle
:
implementation("org.springdoc:springdoc-openapi-webflux-ui:1.6.7")
- Run the app
My build.gradle
:
plugins {
id 'org.springframework.boot' version '2.6.6'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '17'
repositories {
mavenCentral()
}
ext {
set('springCloudVersion', "2021.0.1")
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-webflux'
implementation 'org.springframework.cloud:spring-cloud-stream'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'io.projectreactor:reactor-test'
implementation("org.springdoc:springdoc-openapi-webflux-ui:1.6.7")
}
dependencyManagement {
imports {
mavenBom "org.springframework.cloud:spring-cloud-dependencies:${springCloudVersion}"
}
}
Expected behavior
Web app shouldn't crash
Screenshots
none
Additional context
Versions:
- Spring-boot 2.6.6
- springdoc-openapi-webflux-ui v1.6.7
Any of the following actions fix the problem:
- change the
springdoc-openapi-webflux-ui
to v1.6.6 - remove the
spring-boot-starter-actuator
dependency - remove the
spring-cloud-stream
dependency