Skip to content

springdoc-openapi-webflux-ui v1.6.7 + spring actuator + spring cloud crashes at startup #1617

Closed
@3mtee

Description

@3mtee

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:

  1. Create a new spring boot application at the spring initializr. Add the following dependencies:
    • "Spring Boot Actuator"
    • "Cloud Stream"
    • "Spring Reactive Web"
  2. Programming language doesn't matter (I reproduced the bug with Java and Kotlin).
  3. Download and unpack the archive.
  4. Add the swagger into build.gradle:
implementation("org.springdoc:springdoc-openapi-webflux-ui:1.6.7")
  1. 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:

  1. change the springdoc-openapi-webflux-ui to v1.6.6
  2. remove the spring-boot-starter-actuator dependency
  3. remove the spring-cloud-stream dependency

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions