Skip to content
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

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

Closed
3mtee opened this issue Apr 18, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@3mtee
Copy link

3mtee commented Apr 18, 2022

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
@mshima
Copy link
Contributor

mshima commented Apr 19, 2022

This is probably the same problem #1607.
And is preventing us to migrate to v1.6.7 jhipster/jhipster-bom#744

We have many webflux samples. Only 1 is failing.
Seems a specific scenario.

Edit:
I can confirm that the failing samples uses cloud-stream.

@bnasslahsen
Copy link
Contributor

Thank you @3mtee for the reproducible steps!

@mshima i confirm it's specific to the case when spring-cloud-stream is included.
Should be fixed with the next release.

@bnasslahsen bnasslahsen added the bug Something isn't working label Apr 20, 2022
@mshima
Copy link
Contributor

mshima commented Apr 20, 2022

Thanks @bnasslahsen

@jongidal
Copy link

jongidal commented Apr 29, 2022

I had the same situation.

@bnasslahsen
Copy link
Contributor

@jongidal,

Use v1.6.8

@springdoc springdoc locked as resolved and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants