2

I try to resolve my problem after add springdoc. Maven configuration: SpringBoot 3.0.3 OpenApi 3 I tried with other version sprindoc-ui and the result is the same. If any know answer please help me.

        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-starter-webmvc-ui</artifactId>
            <version>2.0.4</version>
        </dependency>

When I try run application:

Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException:
 Error creating bean with name 'webFluxSupportConverter' defined in class path resource [org/springdoc/core/configuration/SpringDocConfiguration$SpringDocWebFluxSupportConfiguration.class]: Unsatisfied dependency expressed through method 'webFluxSupportConverter' parameter 0: Error creating bean with name 'objectMapperProvider' defined in class path resource [org/springdoc/core/configuration/SpringDocConfiguration.class]: Failed to instantiate [org.springdoc.core.providers.ObjectMapperProvider]: Factory method 'objectMapperProvider' threw exception with message: 'void org.springdoc.core.providers.ObjectMapperProvider.<init>(org.springdoc.core.properties.SpringDocConfigProperties)'

***************************
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.core.configuration.SpringDocConfiguration.objectMapperProvider(SpringDocConfiguration.java:442)

The following method did not exist:

    'void org.springdoc.core.providers.ObjectMapperProvider.<init>(org.springdoc.core.properties.SpringDocConfigProperties)'

The calling method's class, org.springdoc.core.configuration.SpringDocConfiguration, was loaded from the following location:

    jar:file:/C:/Users/user22/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.1.0/springdoc-openapi-starter-common-2.1.0.jar!/org/springdoc/core/configuration/SpringDocConfiguration.class

The called method's class, org.springdoc.core.providers.ObjectMapperProvider, is available from the following locations:

    jar:file:/C:/Users/user22/.m2/repository/org/springdoc/springdoc-openapi-common/1.6.15/springdoc-openapi-common-1.6.15.jar!/org/springdoc/core/providers/ObjectMapperProvider.class
    jar:file:/C:/Users/user22/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.1.0/springdoc-openapi-starter-common-2.1.0.jar!/org/springdoc/core/providers/ObjectMapperProvider.class

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

    org.springdoc.core.providers.ObjectMapperProvider: file:/C:/Users/user22/.m2/repository/org/springdoc/springdoc-openapi-common/1.6.15/springdoc-openapi-common-1.6.15.jar
    io.swagger.v3.core.util.ObjectMapperFactory: file:/C:/Users/user22/.m2/repository/io/swagger/core/v3/swagger-core/2.2.8/swagger-core-2.2.8.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springdoc.core.configuration.SpringDocConfiguration and org.springdoc.core.providers.ObjectMapperProvider


Deluxxx
  • 151
  • 1
  • 13
  • it means you have both!? (mvc +webflux? ..i need to test/re-/search:) (i delete my answer meanwhile;) – xerx593 Apr 26 '23 at 11:32
  • I set like your write. changed mvc to webflux – Deluxxx Apr 26 '23 at 11:47
  • my "mvc" i mean (of course) "spring-boot-starter-web" (sorry!:) and by webflux "spring-boot-starter-..." – xerx593 Apr 26 '23 at 11:49
  • ..and sometimes we/many have this: https://stackoverflow.com/q/53883037/592355 – xerx593 Apr 26 '23 at 11:52
  • 2
    Problem was because I have project with multimodules and there was different springdoc-openapi-starter-webmvc-ui. All modules should has same. Now I have problem in swagger I see: etch error response status is 500 /v3/api-docs – Deluxxx Apr 27 '23 at 09:58
  • glad, you fixed it! +1 ...consider to make it answer/improve the question;) – xerx593 Apr 27 '23 at 10:40

0 Answers0