Skip to content

Error in HateoasHalProvider while upgrade from 3.4.6 to 3.5.0 #45688

Closed as not planned
@afattahi54

Description

@afattahi54

After upgrade from 3.4.6 to 3.5.0

pring-cloud.version is 2024.0.1


Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'modelConverterRegistrar' defined in class path resource [org/springdoc/core/configuration/SpringDocConfiguration.class]: Unsatisfied dependency expressed through method 'modelConverterRegistrar' parameter 0: Error creating bean with name 'collectionModelContentConverter' defined in class path resource [org/springdoc/core/configuration/SpringDocHateoasConfiguration.class]: Unsatisfied dependency expressed through method 'collectionModelContentConverter' parameter 0: Error creating bean with name 'hateoasHalProvider': Invocation of init method failed

***************************
APPLICATION FAILED TO START
***************************


An attempt was made to call a method that does not exist. The attempt was made from the following location:

    org.springdoc.core.providers.HateoasHalProvider.isHalEnabled(HateoasHalProvider.java:81)

The following method did not exist:

    'boolean org.springframework.boot.autoconfigure.hateoas.HateoasProperties.getUseHalAsDefaultJsonMediaType()'

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

    jar:file:/C:/Users/a_fattahi/.m2/repository/org/springdoc/springdoc-openapi-starter-common/2.8.8/springdoc-openapi-starter-common-2.8.8.jar!/org/springdoc/core/providers/HateoasHalProvider.class

The called method's class, org.springframework.boot.autoconfigure.hateoas.HateoasProperties, is available from the following locations:

    jar:file:/C:/Users/a_fattahi/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.5.0/spring-boot-autoconfigure-3.5.0.jar!/org/springframework/boot/autoconfigure/hateoas/HateoasProperties.class

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

    org.springframework.boot.autoconfigure.hateoas.HateoasProperties: file:/C:/Users/a_fattahi/.m2/repository/org/springframework/boot/spring-boot-autoconfigure/3.5.0/spring-boot-autoconfigure-3.5.0.jar


Action:

Correct the classpath of your application so that it contains compatible versions of the classes org.springdoc.core.providers.HateoasHalProvider and org.springframework.boot.autoconfigure.hateoas.HateoasProperties


i have below in pom

   .....

        <spring-cloud.version>2024.0.1</spring-cloud.version>
        <spring-boot.version>3.5.0</spring-boot.version>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-hateoas</artifactId>
        </dependency>

  .....
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>${spring-cloud.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-dependencies</artifactId>
                <version>${spring-boot.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: external-projectFor an external project and not something we can fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions