Skip to content

An unresolvable circular reference with management.endpoint.gateway.enabled=true #2814

Closed
@onacit

Description

@onacit

Describe the bug

  • With Spring Cloud Gateway and management.endpoint.gateway.enabled=true
  • An unresolvable circular reference arises.

To Reproduce

    <version.org.springframework.boot>3.4.0</version.org.springframework.boot>
    <version.org.springframework.cloud>2024.0.0</version.org.springframework.cloud>
   org.springdoc:springdoc-openapi-starter-webflux-ui:2.7.0

Two branches are prepared for reproducing the problem at
spring-cloud/spring-cloud-gateway#3111

Exception encountered during context initialization - cancelling refresh attempt:
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'errorWebExceptionHandler' defined in class path resource [org/springframework/boot/autoconfigure/web/reactive/error/ErrorWebFluxAutoConfiguration.class]:

Unsatisfied dependency expressed through method 'errorWebExceptionHandler' parameter 3: Error creating bean with name 'org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$EnableWebFluxConfiguration': 

Unsatisfied dependency expressed through method 'setConfigurers' parameter 0: Error creating bean with name 'swaggerWebFluxConfigurer' defined in class path resource [org/springdoc/webflux/ui/SwaggerConfig.class]:

Unsatisfied dependency expressed through method 'swaggerWebFluxConfigurer' parameter 3: Error creating bean with name 'actuatorProvider' defined in class path resource [org/springdoc/webflux/core/configuration/SpringDocWebFluxConfiguration$SpringDocWebFluxActuatorConfiguration.class]:

Unsatisfied dependency expressed through method 'actuatorProvider' parameter 4: Error creating bean with name 'webEndpointReactiveHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/endpoint/web/reactive/WebFluxEndpointManagementContextConfiguration.class]: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.reactive.WebFluxEndpointHandlerMapping]: Factory method 'webEndpointReactiveHandlerMapping' threw exception with message: Error creating bean with name 'gatewayControllerEndpoint' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration$GatewayActuatorConfiguration.class]: 

Unsatisfied dependency expressed through method 'gatewayControllerEndpoint' parameter 1: Error creating bean with name 'modifyRequestBodyGatewayFilterFactory' defined in class path resource [org/springframework/cloud/gateway/config/GatewayAutoConfiguration.class]:

Unsatisfied dependency expressed through method 'modifyRequestBodyGatewayFilterFactory' parameter 0: Error creating bean with name 'serverCodecConfigurer': Requested bean is currently in creation: Is there an unresolvable circular reference or an asynchronous initialization dependency?
15:16:40.150 [main] DEBUG o.s.b.f.s.DisposableBeanAdapter -- Custom destroy method 'close' on bean with name 'simpleMeterRegistry' completed

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions