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 cannot be used in a project with org.springframework.boot:spring-boot-starter-validation:3.4.0 #2795

Closed
SimonVonXCVII opened this issue Nov 27, 2024 · 6 comments
Labels
invalid This doesn't seem right

Comments

@SimonVonXCVII
Copy link

SimonVonXCVII commented Nov 27, 2024

Describe the bug

  • If you are reporting a bug, please help to speed up problem diagnosis by providing as
    much information as possible:
    Just use Gradle - bootjar
  • A clear and concise description of what the bug is: the title of an issue is not enough

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using?
  • 3.4.0
  • What modules and versions of springdoc-openapi are you using?
  • org.springdoc:springdoc-openapi-starter-common
  • org.springdoc:springdoc-openapi-starter-webmvc-api
  • org.springdoc:springdoc-openapi-starter-webmvc-ui
  • 2.7.0
  • What is the actual and the expected result using OpenAPI Description (yml or json)?
  • Provide with a sample code (HelloController) or Test that reproduces the problem
  • https://github.com/SimonVonXCVII/turing.git

Expected behavior

  • A clear and concise description of what you expected to happen.
  • What is the expected result using OpenAPI Description (yml or json)?

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot 2024-11-27 at 11 27 41 AM

Additional context
Add any other context about the problem here.

@krezovic
Copy link

It looks like problem in Spring Framework - the class that triggers the error comes from there (and it appears to be new in 6.2.0)

@eazybytes
Copy link

The same issue when using Spring Boot 3.4.0 version. What is the solution or work around ?

@fabriziodelfranco
Copy link

In one of my projects, having Spring Boot 3.4.0 and springdoc-openapi-starter-webmvc-ui 2.7.0 the application fails to start.
The same project, configured with Boot 3.3.5 and springdoc-openapi-starter-webmvc-ui 2.6.0 has no issues.

`***************************
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.springdoc.webmvc.ui.SwaggerWelcomeCommon.<init>(SwaggerWelcomeCommon.java:56)

The following method did not exist:

'void org.springdoc.ui.AbstractSwaggerWelcome.<init>(org.springdoc.core.properties.SwaggerUiConfigProperties, org.springdoc.core.properties.SpringDocConfigProperties)'

The calling method's class, org.springdoc.webmvc.ui.SwaggerWelcomeCommon, was loaded from the following location:

jar:file:/Users/fdelfran/.m2/repository/org/springdoc/springdoc-openapi-starter-webmvc-ui/2.7.0/springdoc-openapi-starter-webmvc-ui-2.7.0.jar!/org/springdoc/webmvc/ui/SwaggerWelcomeCommon.class

The called method's class, org.springdoc.ui.AbstractSwaggerWelcome, is available from the following locations:

jar:file:/Users/fdelfran/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.6.0/springdoc-openapi-starter-common-2.6.0.jar!/org/springdoc/ui/AbstractSwaggerWelcome.class

The called method's class hierarchy was loaded from the following locations:

org.springdoc.ui.AbstractSwaggerWelcome: file:/Users/fdelfran/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.6.0/springdoc-openapi-starter-common-2.6.0.jar

Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springdoc.webmvc.ui.SwaggerWelcomeCommon and org.springdoc.ui.AbstractSwaggerWelcome
`

@krezovic
Copy link

krezovic commented Dec 3, 2024

As I said, the problem is in Spring Framework 6.2.0. It is already fixed in 6.2.1-SNAPSHOT and will be part of 6.2.1 release, that will be included with Spring Boot 3.4.1 release later this month.

Current workaround is to force snapshot version of framework, as follows

repositories {
...
    maven { url = uri("https://repo.spring.io/snapshot") }
...
}
...

ext["spring-framework.version"] = "6.2.1-SNAPSHOT"
...

spring-projects/spring-framework#33936
spring-projects/spring-framework@5e7b3a3

@krezovic

This comment was marked as off-topic.

@fabriziodelfranco
Copy link

Thanks @krezovic, sorry for being off topic.

@bnasslahsen bnasslahsen added the invalid This doesn't seem right label Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

5 participants