rsocket-broker / rsocket-broker-http-bridge

Apache License 2.0
2 stars 3 forks source link

Gateway is not starting due to circular dependency in RSocketAutoConfiguration.class and RSocketRoutingAutoConfiguration.class #8

Closed sachins-dev closed 2 years ago

sachins-dev commented 2 years ago

Hi @spencergibb , @OlgaMaciaszek , @OlegDokuka Please help with this.

Steps to reproduce.

  1. Generate the 'rsocket-broker-http-bridge' jar using the latest codebase.
  2. Use generated jar as a dependency in gateway application.
  3. Try to run the gateway application
  4. Application will fail to start due to circular dependency.

=========== pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.6.4</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

    <groupId>com.sachin.client.gateway</groupId>
    <artifactId>client-gateway</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>client-gateway</name>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>17</java.version>
        <!-- RSocket properties -->
        <rsocket-broker-http-bridge.version>0.3.0</rsocket-broker-http-bridge.version>
        <!-- Dependency management properties -->
        <spring-cloud.version>2021.0.0</spring-cloud.version>
    </properties>

    <dependencies>
        <!-- Start: spring cloud libraries -->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-function-web</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-gateway</artifactId>
        </dependency>
        <!-- End: spring cloud libraries -->

        <!-- Start: rsocket libraries -->
        <dependency>
            <groupId>io.rsocket.broker</groupId>
            <artifactId>rsocket-broker-http-bridge</artifactId>
            <version>${rsocket-broker-http-bridge.version}</version>
        </dependency>
        <!-- End: rsocket libraries -->

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>io.projectreactor</groupId>
            <artifactId>reactor-test</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <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>
        </dependencies>
    </dependencyManagement>

    <build>
       <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

============ Startup logs

2022-03-30 00:40:11.143 INFO 76610 --- [ main] c.s.c.gateway.ClientGatewayApplication : No active profile set, falling back to 1 default profile: "default" 2022-03-30 00:40:11.877 DEBUG 76610 --- [ main] o.s.cloud.context.scope.GenericScope : Generating bean factory id from names: [adaptCachedBodyGlobalFilter, addRequestHeaderGatewayFilterFactory, addRequestParameterGatewayFilterFactory, addResponseHeaderGatewayFilterFactory, afterRoutePredicateFactory, applicationAvailability, applicationTaskExecutor, beforeRoutePredicateFactory, betweenRoutePredicateFactory, brokerClientProperties, brokerClientRSocketRequester, brokerMetadata, brokerRSocketRequesterBuilder, cacheRequestBodyGatewayFilterFactory, cachedCompositeRouteLocator, clientConnectorCustomizer, clientGatewayApplication, clientRSocketStrategiesCustomizer, clientThreadManager, cloudFoundryRouteServiceRoutePredicateFactory, compositeCompatibilityVerifier, compositeDiscoveryClient, configDataContextRefresher, configurationPropertiesBeans, configurationPropertiesRebinder, cookieRoutePredicateFactory, dedupeResponseHeaderGatewayFilterFactory, defaultClientTransportFactory, defaultCodecCustomizer, defaultPartHttpMessageReaderCustomizer, defaultValidator, defaultsBindHandlerAdvisor, discoveryLocatorProperties, environmentManager, errorAttributes, errorWebExceptionHandler, exchangeStrategiesCustomizer, ff, filteringWebHandler, forceAutoProxyCreatorToUseClassProxying, forwardPathFilter, forwardRoutingFilter, forwardedHeadersFilter, functionCatalog, functionHandlerMapping, functionRSocketConnectorConfigurer, functionRSocketMessageHandler, functionRouter, functionStringConverter, gRPCRequestHeadersFilter, gRPCResponseHeadersFilter, gatewayConfigurationService, gatewayHttpClientFactory, gatewayProperties, globalCorsProperties, gzipMessageBodyResolver, handlerFunctionAdapter, headerRoutePredicateFactory, hostRoutePredicateFactory, httpClientProperties, httpHandler, inMemoryRouteDefinitionRepository, inetUtils, inetUtilsProperties, io.rsocket.broker.client.spring.BrokerClientAutoConfiguration, io.rsocket.broker.client.spring.BrokerClientRSocketStrategiesAutoConfiguration, io.rsocket.broker.http-bridge-io.rsocket.broker.http.bridge.config.RSocketHttpBridgeProperties, io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration, jacksonCborRSocketStrategyCustomizer, jacksonCodecCustomizer, jacksonJsonRSocketStrategyCustomizer, jacksonObjectMapper, jacksonObjectMapperBuilder, jsonComponentModule, jsonMapper, lifecycleProcessor, loadBalancerClientsDefaultsMappingsProvider, localeContextResolver, loggingRebinder, mapRequestHeaderGatewayFilterFactory, mbeanExporter, mbeanServer, methodRoutePredicateFactory, methodValidationPostProcessor, modifyRequestBodyGatewayFilterFactory, modifyResponseBodyGatewayFilterFactory, nativeFunctionInvocationHelper, nettyReactiveWebServerFactory, nettyWebServerFactoryCustomizer, nettyWriteResponseFilter, noLoadBalancerClientFilter, objectNamingStrategy, org.springframework.boot.autoconfigure.AutoConfigurationPackages, org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration, org.springframework.boot.autoconfigure.aop.AopAutoConfiguration, org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$ClassProxyingConfiguration, org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration, org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration, org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration, org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration$DefaultCodecsConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration$JacksonCodecConfiguration, org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration, org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$ParameterNamesModuleConfiguration, org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration, org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration$JacksonCborStrategyConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration$JacksonJsonStrategyConfiguration, org.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfiguration, org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration, org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration, org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration, org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration, org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration$NettyWebServerFactoryCustomizerConfiguration, org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration$AnnotationConfig, org.springframework.boot.autoconfigure.web.reactive.ReactiveMultipartAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryConfiguration$EmbeddedNetty, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$EnableWebFluxConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$WebFluxConfig, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$WelcomePageConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebSessionIdResolverAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpConnectorAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpConnectorConfiguration$ReactorNetty, org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration$WebClientCodecsConfiguration, org.springframework.boot.context.internalConfigurationPropertiesBinder, org.springframework.boot.context.internalConfigurationPropertiesBinderFactory, org.springframework.boot.context.properties.BoundConfigurationProperties, org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor, org.springframework.boot.context.properties.EnableConfigurationPropertiesRegistrar.methodValidationExcludeFilter, org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor, org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration, org.springframework.cloud.autoconfigure.LifecycleMvcEndpointAutoConfiguration, org.springframework.cloud.autoconfigure.RefreshAutoConfiguration, org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$RefreshScopeBeanDefinitionEnhancer, org.springframework.cloud.client.CommonsClientAutoConfiguration, org.springframework.cloud.client.ReactiveCommonsClientAutoConfiguration, org.springframework.cloud.client.discovery.composite.CompositeDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.simple.reactive.SimpleReactiveDiscoveryClientAutoConfiguration, org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration, org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration, org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationConfiguration, org.springframework.cloud.client.serviceregistry.ServiceRegistryAutoConfiguration, org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration, org.springframework.cloud.commons.httpclient.HttpClientConfiguration, org.springframework.cloud.commons.util.UtilAutoConfiguration, org.springframework.cloud.configuration.CompatibilityVerifierAutoConfiguration, org.springframework.cloud.function.cloudevent.CloudEventsFunctionExtensionConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration$JsonMapperConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration$PlainFunctionScanConfiguration, org.springframework.cloud.function.rsocket.RSocketAutoConfiguration, org.springframework.cloud.function.rsocket.RSocketCustomizerConfiguration, org.springframework.cloud.function.rsocket.RSocketRoutingAutoConfiguration, org.springframework.cloud.function.web.flux.FunctionController, org.springframework.cloud.function.web.flux.ReactorAutoConfiguration, org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration, org.springframework.cloud.gateway.discovery.GatewayDiscoveryClientAutoConfiguration, org.springframework.cloud.gateway.discovery.GatewayDiscoveryClientAutoConfiguration$ReactiveDiscoveryClientRouteDefinitionLocatorConfiguration, org.springframework.context.annotation.internalAutowiredAnnotationProcessor, org.springframework.context.annotation.internalCommonAnnotationProcessor, org.springframework.context.annotation.internalConfigurationAnnotationProcessor, org.springframework.context.event.internalEventListenerFactory, org.springframework.context.event.internalEventListenerProcessor, parameterNamesModule, pathRoutePredicateFactory, prefixPathGatewayFilterFactory, preserveHostHeaderGatewayFilterFactory, propertiesRouteDefinitionLocator, propertySourcesPlaceholderConfigurer, queryRoutePredicateFactory, rSocketStrategies, rSocketStrategiesCustomizer, rc, reactiveCompositeDiscoveryClient, reactiveWebServerFactoryCustomizer, reactorClientHttpConnector, reactorNettyRequestUpgradeStrategy, reactorNettyWebSocketClient, reactorServerResourceFactory, readBodyPredicateFactory, redirectToGatewayFilterFactory, refreshEventListener, refreshScope, remoteAddrRoutePredicateFactory, removeCachedBodyFilter, removeHopByHopHeadersFilter, removeRequestHeaderGatewayFilterFactory, removeRequestParameterGatewayFilterFactory, removeResponseHeaderGatewayFilterFactory, requestHeaderSizeGatewayFilterFactory, requestHeaderToRequestUriGatewayFilterFactory, requestMappingHandlerAdapter, requestMappingHandlerMapping, requestSizeGatewayFilterFactory, resourceHandlerMapping, resourceUrlProvider, responseBodyResultHandler, responseEntityResultHandler, responseStatusExceptionHandler, retryGatewayFilterFactory, rewriteLocationResponseHeaderGatewayFilterFactory, rewritePathGatewayFilterFactory, rewriteResponseHeaderGatewayFilterFactory, routeDefinitionLocator, routeDefinitionRouteLocator, routeLocatorBuilder, routePredicateHandlerMapping, routeRefreshListener, routeToRequestUrlFilter, routerFunctionMapping, routingFilter, rr, rs, saveSessionGatewayFilterFactory, scheduledBeanLazyInitializationExcludeFilter, secureHeadersGatewayFilterFactory, secureHeadersProperties, server-org.springframework.boot.autoconfigure.web.ServerProperties, serverCodecConfigurer, serverResponseResultHandler, setPathGatewayFilterFactory, setRequestHeaderGatewayFilterFactory, setRequestHostHeaderGatewayFilterFactory, setResponseHeaderGatewayFilterFactory, setStatusGatewayFilterFactory, simpleDestinationResolver, simpleDiscoveryClient, simpleDiscoveryProperties, simpleHandlerAdapter, simpleReactiveDiscoveryClient, simpleReactiveDiscoveryProperties, simpleRequestBuilder, spring.cloud.compatibility-verifier-org.springframework.cloud.configuration.CompatibilityVerifierProperties, spring.cloud.discovery.client.health-indicator-org.springframework.cloud.client.discovery.health.DiscoveryClientHealthIndicatorProperties, spring.cloud.function-org.springframework.cloud.function.context.FunctionProperties, spring.cloud.function.rsocket-org.springframework.cloud.function.rsocket.RSocketFunctionProperties, spring.cloud.function.web.export-org.springframework.cloud.function.web.source.ExporterProperties, spring.cloud.gateway.loadbalancer-org.springframework.cloud.gateway.config.GatewayLoadBalancerProperties, spring.cloud.refresh-org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$RefreshProperties, spring.cloud.service-registry.auto-registration-org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties, spring.codec-org.springframework.boot.autoconfigure.codec.CodecProperties, spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties, spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties, spring.lifecycle-org.springframework.boot.autoconfigure.context.LifecycleProperties, spring.netty-org.springframework.boot.autoconfigure.netty.NettyProperties, spring.rsocket-org.springframework.boot.autoconfigure.rsocket.RSocketProperties, spring.sql.init-org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties, spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties, spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties, spring.web-org.springframework.boot.autoconfigure.web.WebProperties, spring.webflux-org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties, spring.webflux.multipart-org.springframework.boot.autoconfigure.web.reactive.ReactiveMultipartProperties, springApplicationAdminRegistrar, springBootVersionVerifier, standardJacksonObjectMapperBuilderCustomizer, stringToZonedDateTimeConverter, stripPrefixGatewayFilterFactory, taskExecutorBuilder, taskSchedulerBuilder, transferEncodingNormalizationHeadersFilter, viewResolutionResultHandler, webClientBuilder, webFluxAdapterRegistry, webFluxContentTypeResolver, webFluxConversionService, webFluxValidator, webFluxWebSocketHandlerAdapter, webHandler, webServerFactoryCustomizerBeanPostProcessor, webSessionIdResolver, webSessionManager, webSocketService, websocketRoutingFilter, weightCalculatorWebFilter, weightRoutePredicateFactory, welcomePageRouterFunctionMapping, xForwardedHeadersFilter, xForwardedRemoteAddrRoutePredicateFactory] 2022-03-30 00:40:11.879 INFO 76610 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=2317865b-445c-349f-8674-e553d9141f93 2022-03-30 00:40:12.375 DEBUG 76610 --- [ main] o.s.c.gateway.config.GatewayProperties : Routes supplied from Gateway Properties: [RouteDefinition{id='bridge', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/age-group}}], filters=[], uri=forward:/rsocket-server/age-group, order=0, metadata={}}] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [XForwardedRemoteAddr] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight] 2022-03-30 00:40:12.492 INFO 76610 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService] 2022-03-30 00:40:12.579 INFO 76610 --- [ main] o.s.c.f.web.flux.FunctionHandlerMapping : FunctionCatalog: org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry@16a5eb6d 2022-03-30 00:40:12.655 WARN 76610 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'functionRSocketMessageHandler' defined in class path resource [org/springframework/cloud/function/rsocket/RSocketAutoConfiguration.class]: Unsatisfied dependency expressed through method 'functionRSocketMessageHandler' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'brokerClientRSocketRequester' defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'brokerClientRSocketRequester' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'brokerRSocketRequesterBuilder' defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'brokerRSocketRequesterBuilder' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'functionRSocketConnectorConfigurer' defined in class path resource [org/springframework/cloud/function/rsocket/RSocketRoutingAutoConfiguration.class]: Unsatisfied dependency expressed through method 'functionRSocketConnectorConfigurer' parameter 0; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'functionRSocketMessageHandler': Requested bean is currently in creation: Is there an unresolvable circular reference? 2022-03-30 00:40:12.672 INFO 76610 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-03-30 00:40:12.687 ERROR 76610 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

┌─────┐ | functionRSocketMessageHandler defined in class path resource [org/springframework/cloud/function/rsocket/RSocketAutoConfiguration.class] ↑ ↓ | io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration ↑ ↓ | brokerClientRSocketRequester defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class] ↑ ↓ | brokerRSocketRequesterBuilder defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class] ↑ ↓ | functionRSocketConnectorConfigurer defined in class path resource [org/springframework/cloud/function/rsocket/RSocketRoutingAutoConfiguration.class] └─────┘

Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

Disconnected from the target VM, address: '127.0.0.1:55466', transport: 'socket'

Process finished with exit code 1

OlgaMaciaszek commented 2 years ago

Hello, @sachins-dev. Thanks for reporting the issue. Unfortunately, I was not able to reproduce it. Here is a sample with a similar setup that works just fine. Please provide a minimal, complete, verifiable example that reproduces the issue.

sachins-dev commented 2 years ago

Hi @OlgaMaciaszek, Thanks for the reply. I have forked the specified repositories and I am able to reproduce the issue. https://github.com/sachins-dev/rsocket-broker-http-bridge https://github.com/sachins-dev/spring-one-2021-rsocket-http-sample

Steps to reproduce the issue.

  1. Generate the 'rsocket-broker-http-bridge' jar using the latest commit (SHA - e21a1bfb44fe203994dd0a3a22dafae4b574e590) https://github.com/sachins-dev/rsocket-broker-http-bridge
  2. Use generated jar as a dependency in gateway application.
  3. Try to run the gateway application https://github.com/sachins-dev/spring-one-2021-rsocket-http-sample
  4. Application will fail to start due to circular dependency.

As per my analysis the issue is coming on latest commit (SHA - e21a1bfb44fe203994dd0a3a22dafae4b574e590) because when I built the 'rsocket-broker-http-bridge' jar locally using the below commit (SHA - 2908c0332d4e03d52d04344c55a67ff511466b10) and used that dependency in the gateway, it is starting successfully without circular dependency issue.


Startup logs:

2022-04-04 22:56:15.485 INFO 6660 --- [ main] r.r.sample.gateway.GatewayApplication : No active profile set, falling back to 1 default profile: "default" 2022-04-04 22:56:16.501 DEBUG 6660 --- [ main] o.s.cloud.context.scope.GenericScope : Generating bean factory id from names: [adaptCachedBodyGlobalFilter, addRequestHeaderGatewayFilterFactory, addRequestParameterGatewayFilterFactory, addResponseHeaderGatewayFilterFactory, afterRoutePredicateFactory, applicationAvailability, applicationTaskExecutor, beansEndpoint, beforeRoutePredicateFactory, betweenRoutePredicateFactory, brokerClientProperties, brokerClientRSocketRequester, brokerMetadata, brokerRSocketRequesterBuilder, cacheRequestBodyGatewayFilterFactory, cachedCompositeRouteLocator, cachesEndpoint, classLoaderMetrics, clientConnectorCustomizer, clientRSocketStrategiesCustomizer, clientThreadManager, cloudFoundryRouteServiceRoutePredicateFactory, commonsFeatures, compositeCompatibilityVerifier, compositeDiscoveryClient, conditionsReportEndpoint, configDataContextRefresher, configurationPropertiesBeans, configurationPropertiesRebinder, configurationPropertiesReportEndpoint, controllerEndpointDiscoverer, controllerEndpointHandlerMapping, controllerExposeExcludePropertyEndpointFilter, cookieRoutePredicateFactory, dedupeResponseHeaderGatewayFilterFactory, defaultClientTransportFactory, defaultCodecCustomizer, defaultPartHttpMessageReaderCustomizer, defaultValidator, defaultWebClientExchangeTagsProvider, defaultsBindHandlerAdvisor, discoveryClientHealthIndicator, discoveryCompositeHealthContributor, discoveryLocatorProperties, diskSpaceHealthIndicator, diskSpaceMetrics, dispatcherHandlerMappingDescriptionProvider, dumpEndpoint, eagerlyInitializeJmxEndpointExporter, endpointCachingOperationInvokerAdvisor, endpointMediaTypes, endpointObjectNameFactory, endpointOperationParameterMapper, environmentEndpoint, environmentManager, errorAttributes, errorWebExceptionHandler, exchangeStrategiesCustomizer, featuresEndpoint, ff, fileDescriptorMetrics, filteringWebHandler, forceAutoProxyCreatorToUseClassProxying, forwardPathFilter, forwardRoutingFilter, forwardedHeadersFilter, functionCatalog, functionHandlerMapping, functionRSocketConnectorConfigurer, functionRSocketMessageHandler, functionRouter, functionStringConverter, functionsEndpoint, gRPCRequestHeadersFilter, gRPCResponseHeadersFilter, gatewayApplication, gatewayConfigurationService, gatewayControllerEndpoint, gatewayHttpClientFactory, gatewayHttpTagsProvider, gatewayMetricFilter, gatewayProperties, gatewayRouteTagsProvider, globalCorsProperties, gzipMessageBodyResolver, handlerFunctionAdapter, headerRoutePredicateFactory, healthContributorRegistry, healthEndpoint, healthEndpointGroups, healthEndpointGroupsBeanPostProcessor, healthEndpointWebFluxHandlerMapping, healthHttpCodeStatusMapper, healthStatusAggregator, heapDumpWebEndpoint, hostRoutePredicateFactory, httpClientProperties, httpHandler, inMemoryRouteDefinitionRepository, inetUtils, inetUtilsProperties, infoEndpoint, io.rsocket.broker.client.spring.BrokerClientAutoConfiguration, io.rsocket.broker.client.spring.BrokerClientRSocketStrategiesAutoConfiguration, io.rsocket.broker.http-bridge-io.rsocket.broker.http.bridge.config.RSocketHttpBridgeProperties, io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration, jacksonCborRSocketStrategyCustomizer, jacksonCodecCustomizer, jacksonJsonRSocketStrategyCustomizer, jacksonObjectMapper, jacksonObjectMapperBuilder, jmxAnnotationEndpointDiscoverer, jmxIncludeExcludePropertyEndpointFilter, jmxMBeanExporter, jsonComponentModule, jsonMapper, jvmGcMetrics, jvmHeapPressureMetrics, jvmMemoryMetrics, jvmThreadMetrics, lifecycleProcessor, loadBalancerClientsDefaultsMappingsProvider, localeContextResolver, logbackMetrics, loggersEndpoint, loggingRebinder, management.endpoint.configprops-org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointProperties, management.endpoint.env-org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointProperties, management.endpoint.health-org.springframework.boot.actuate.autoconfigure.health.HealthEndpointProperties, management.endpoint.logfile-org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointProperties, management.endpoints.jmx-org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointProperties, management.endpoints.web-org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties, management.endpoints.web.cors-org.springframework.boot.actuate.autoconfigure.endpoint.web.CorsEndpointProperties, management.health.diskspace-org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthIndicatorProperties, management.info-org.springframework.boot.actuate.autoconfigure.info.InfoContributorProperties, management.metrics-org.springframework.boot.actuate.autoconfigure.metrics.MetricsProperties, management.metrics.export.simple-org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleProperties, management.server-org.springframework.boot.actuate.autoconfigure.web.server.ManagementServerProperties, mapRequestHeaderGatewayFilterFactory, mappingsEndpoint, mbeanExporter, mbeanServer, meterRegistryPostProcessor, methodRoutePredicateFactory, methodValidationPostProcessor, metricsEndpoint, metricsHttpClientUriTagFilter, metricsHttpServerUriTagFilter, metricsWebClientCustomizer, micrometerClock, modifyRequestBodyGatewayFilterFactory, modifyResponseBodyGatewayFilterFactory, nativeFunctionInvocationHelper, nettyReactiveWebServerFactory, nettyWebServerFactoryCustomizer, nettyWriteResponseFilter, noLoadBalancerClientFilter, objectNamingStrategy, org.springframework.boot.actuate.autoconfigure.audit.AuditEventsEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.availability.AvailabilityHealthContributorAutoConfiguration, org.springframework.boot.actuate.autoconfigure.beans.BeansEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.cache.CachesEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.condition.ConditionsReportEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.context.properties.ConfigurationPropertiesReportEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.endpoint.EndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.endpoint.web.reactive.WebFluxEndpointManagementContextConfiguration, org.springframework.boot.actuate.autoconfigure.env.EnvironmentEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.health.HealthContributorAutoConfiguration, org.springframework.boot.actuate.autoconfigure.health.HealthEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration, org.springframework.boot.actuate.autoconfigure.health.HealthEndpointReactiveWebExtensionConfiguration, org.springframework.boot.actuate.autoconfigure.health.HealthEndpointReactiveWebExtensionConfiguration$WebFluxAdditionalHealthEndpointPathsConfiguration, org.springframework.boot.actuate.autoconfigure.health.ReactiveHealthEndpointConfiguration, org.springframework.boot.actuate.autoconfigure.info.InfoContributorAutoConfiguration, org.springframework.boot.actuate.autoconfigure.info.InfoEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.logging.LogFileWebEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.logging.LoggersEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.management.HeapDumpWebEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.management.ThreadDumpEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.CompositeMeterRegistryAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.JvmMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.LogbackMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.MetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.MetricsEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.SystemMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.export.simple.SimpleMetricsExportAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.integration.IntegrationMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.startup.StartupTimeMetricsListenerAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.task.TaskExecutorMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.web.client.HttpClientMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.web.client.WebClientMetricsConfiguration, org.springframework.boot.actuate.autoconfigure.metrics.web.reactive.WebFluxMetricsAutoConfiguration, org.springframework.boot.actuate.autoconfigure.scheduling.ScheduledTasksEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.system.DiskSpaceHealthContributorAutoConfiguration, org.springframework.boot.actuate.autoconfigure.trace.http.HttpTraceEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration, org.springframework.boot.actuate.autoconfigure.web.mappings.MappingsEndpointAutoConfiguration$ReactiveWebConfiguration, org.springframework.boot.actuate.autoconfigure.web.reactive.ReactiveManagementContextAutoConfiguration, org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration, org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration$SameManagementContextConfiguration, org.springframework.boot.actuate.autoconfigure.web.server.ManagementContextAutoConfiguration$SameManagementContextConfiguration$EnableSameManagementContextConfiguration, org.springframework.boot.autoconfigure.AutoConfigurationPackages, org.springframework.boot.autoconfigure.admin.SpringApplicationAdminJmxAutoConfiguration, org.springframework.boot.autoconfigure.aop.AopAutoConfiguration, org.springframework.boot.autoconfigure.aop.AopAutoConfiguration$ClassProxyingConfiguration, org.springframework.boot.autoconfigure.availability.ApplicationAvailabilityAutoConfiguration, org.springframework.boot.autoconfigure.context.ConfigurationPropertiesAutoConfiguration, org.springframework.boot.autoconfigure.context.LifecycleAutoConfiguration, org.springframework.boot.autoconfigure.context.PropertyPlaceholderAutoConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration$DefaultCodecsConfiguration, org.springframework.boot.autoconfigure.http.codec.CodecsAutoConfiguration$JacksonCodecConfiguration, org.springframework.boot.autoconfigure.info.ProjectInfoAutoConfiguration, org.springframework.boot.autoconfigure.internalCachingMetadataReaderFactory, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$Jackson2ObjectMapperBuilderCustomizerConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperBuilderConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$JacksonObjectMapperConfiguration, org.springframework.boot.autoconfigure.jackson.JacksonAutoConfiguration$ParameterNamesModuleConfiguration, org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration, org.springframework.boot.autoconfigure.netty.NettyAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketMessagingAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketRequesterAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration$JacksonCborStrategyConfiguration, org.springframework.boot.autoconfigure.rsocket.RSocketStrategiesAutoConfiguration$JacksonJsonStrategyConfiguration, org.springframework.boot.autoconfigure.sql.init.SqlInitializationAutoConfiguration, org.springframework.boot.autoconfigure.task.TaskExecutionAutoConfiguration, org.springframework.boot.autoconfigure.task.TaskSchedulingAutoConfiguration, org.springframework.boot.autoconfigure.validation.ValidationAutoConfiguration, org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration, org.springframework.boot.autoconfigure.web.embedded.EmbeddedWebServerFactoryCustomizerAutoConfiguration$NettyWebServerFactoryCustomizerConfiguration, org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.HttpHandlerAutoConfiguration$AnnotationConfig, org.springframework.boot.autoconfigure.web.reactive.ReactiveMultipartAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.ReactiveWebServerFactoryConfiguration$EmbeddedNetty, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$EnableWebFluxConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$WebFluxConfig, org.springframework.boot.autoconfigure.web.reactive.WebFluxAutoConfiguration$WelcomePageConfiguration, org.springframework.boot.autoconfigure.web.reactive.WebSessionIdResolverAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.error.ErrorWebFluxAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpConnectorAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.ClientHttpConnectorConfiguration$ReactorNetty, org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration, org.springframework.boot.autoconfigure.web.reactive.function.client.WebClientAutoConfiguration$WebClientCodecsConfiguration, org.springframework.boot.context.internalConfigurationPropertiesBinder, org.springframework.boot.context.internalConfigurationPropertiesBinderFactory, org.springframework.boot.context.properties.BoundConfigurationProperties, org.springframework.boot.context.properties.ConfigurationPropertiesBindingPostProcessor, org.springframework.boot.context.properties.EnableConfigurationPropertiesRegistrar.methodValidationExcludeFilter, org.springframework.boot.sql.init.dependency.DatabaseInitializationDependencyConfigurer$DependsOnDatabaseInitializationPostProcessor, org.springframework.cloud.autoconfigure.ConfigurationPropertiesRebinderAutoConfiguration, org.springframework.cloud.autoconfigure.LifecycleMvcEndpointAutoConfiguration, org.springframework.cloud.autoconfigure.PauseResumeEndpointsConfiguration, org.springframework.cloud.autoconfigure.RefreshAutoConfiguration, org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$RefreshScopeBeanDefinitionEnhancer, org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration, org.springframework.cloud.autoconfigure.RefreshEndpointAutoConfiguration$RefreshEndpointConfiguration, org.springframework.cloud.autoconfigure.RestartEndpointWithoutIntegrationConfiguration, org.springframework.cloud.client.CommonsClientAutoConfiguration, org.springframework.cloud.client.CommonsClientAutoConfiguration$ActuatorConfiguration, org.springframework.cloud.client.CommonsClientAutoConfiguration$DiscoveryLoadBalancerConfiguration, org.springframework.cloud.client.ReactiveCommonsClientAutoConfiguration, org.springframework.cloud.client.ReactiveCommonsClientAutoConfiguration$ReactiveDiscoveryLoadBalancerConfiguration, org.springframework.cloud.client.discovery.composite.CompositeDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.simple.SimpleDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.simple.reactive.SimpleReactiveDiscoveryClientAutoConfiguration, org.springframework.cloud.client.discovery.simple.reactive.SimpleReactiveDiscoveryClientAutoConfiguration$HealthConfiguration, org.springframework.cloud.client.loadbalancer.LoadBalancerDefaultMappingsProviderAutoConfiguration, org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationAutoConfiguration, org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationConfiguration, org.springframework.cloud.client.serviceregistry.ServiceRegistryAutoConfiguration, org.springframework.cloud.commons.config.CommonsConfigAutoConfiguration, org.springframework.cloud.commons.httpclient.HttpClientConfiguration, org.springframework.cloud.commons.util.UtilAutoConfiguration, org.springframework.cloud.configuration.CompatibilityVerifierAutoConfiguration, org.springframework.cloud.function.cloudevent.CloudEventsFunctionExtensionConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration$JsonMapperConfiguration, org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration$PlainFunctionScanConfiguration, org.springframework.cloud.function.context.config.FunctionsEndpointAutoConfiguration, org.springframework.cloud.function.rsocket.RSocketAutoConfiguration, org.springframework.cloud.function.rsocket.RSocketCustomizerConfiguration, org.springframework.cloud.function.rsocket.RSocketRoutingAutoConfiguration, org.springframework.cloud.function.web.flux.FunctionController, org.springframework.cloud.function.web.flux.ReactorAutoConfiguration, org.springframework.cloud.function.web.source.FunctionExporterAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration$GatewayActuatorConfiguration, org.springframework.cloud.gateway.config.GatewayAutoConfiguration$NettyConfiguration, org.springframework.cloud.gateway.config.GatewayClassPathWarningAutoConfiguration, org.springframework.cloud.gateway.config.GatewayMetricsAutoConfiguration, org.springframework.cloud.gateway.config.GatewayNoLoadBalancerClientAutoConfiguration, org.springframework.cloud.gateway.discovery.GatewayDiscoveryClientAutoConfiguration, org.springframework.cloud.gateway.discovery.GatewayDiscoveryClientAutoConfiguration$ReactiveDiscoveryClientRouteDefinitionLocatorConfiguration, org.springframework.context.annotation.internalAutowiredAnnotationProcessor, org.springframework.context.annotation.internalCommonAnnotationProcessor, org.springframework.context.annotation.internalConfigurationAnnotationProcessor, org.springframework.context.event.internalEventListenerFactory, org.springframework.context.event.internalEventListenerProcessor, parameterNamesModule, pathMappedEndpoints, pathRoutePredicateFactory, pingHealthContributor, prefixPathGatewayFilterFactory, preserveHostHeaderGatewayFilterFactory, processorMetrics, propertiesMeterFilter, propertiesRouteDefinitionLocator, propertiesTagsProvider, propertySourcesPlaceholderConfigurer, queryRoutePredicateFactory, rSocketStrategies, rSocketStrategiesCustomizer, rc, reactiveCommonsFeatures, reactiveCompositeDiscoveryClient, reactiveDiscoveryClients, reactiveHealthContributorRegistry, reactiveHealthEndpointWebExtension, reactiveWebChildContextFactory, reactiveWebServerFactoryCustomizer, reactorClientHttpConnector, reactorNettyRequestUpgradeStrategy, reactorNettyWebSocketClient, reactorServerResourceFactory, readBodyPredicateFactory, redirectToGatewayFilterFactory, refreshEndpoint, refreshEventListener, refreshScope, refreshScopeHealthIndicator, remoteAddrRoutePredicateFactory, removeCachedBodyFilter, removeHopByHopHeadersFilter, removeRequestHeaderGatewayFilterFactory, removeRequestParameterGatewayFilterFactory, removeResponseHeaderGatewayFilterFactory, requestHeaderSizeGatewayFilterFactory, requestHeaderToRequestUriGatewayFilterFactory, requestMappingHandlerAdapter, requestMappingHandlerMapping, requestSizeGatewayFilterFactory, resourceHandlerMapping, resourceUrlProvider, responseBodyResultHandler, responseEntityResultHandler, responseStatusExceptionHandler, retryGatewayFilterFactory, rewriteLocationResponseHeaderGatewayFilterFactory, rewritePathGatewayFilterFactory, rewriteResponseHeaderGatewayFilterFactory, routeDefinitionLocator, routeDefinitionMetrics, routeDefinitionRouteLocator, routeLocatorBuilder, routePredicateHandlerMapping, routeRefreshListener, routeToRequestUrlFilter, routerFunctionMapping, routingFilter, rr, rs, saveSessionGatewayFilterFactory, scheduledBeanLazyInitializationExcludeFilter, scheduledTasksEndpoint, secureHeadersGatewayFilterFactory, secureHeadersProperties, server-org.springframework.boot.autoconfigure.web.ServerProperties, serverCodecConfigurer, serverResponseResultHandler, setPathGatewayFilterFactory, setRequestHeaderGatewayFilterFactory, setRequestHostHeaderGatewayFilterFactory, setResponseHeaderGatewayFilterFactory, setStatusGatewayFilterFactory, simpleConfig, simpleDestinationResolver, simpleDiscoveryClient, simpleDiscoveryProperties, simpleHandlerAdapter, simpleMeterRegistry, simpleReactiveDiscoveryClient, simpleReactiveDiscoveryClientHealthIndicator, simpleReactiveDiscoveryProperties, simpleRequestBuilder, spring.cloud.compatibility-verifier-org.springframework.cloud.configuration.CompatibilityVerifierProperties, spring.cloud.discovery.client.health-indicator-org.springframework.cloud.client.discovery.health.DiscoveryClientHealthIndicatorProperties, spring.cloud.function-org.springframework.cloud.function.context.FunctionProperties, spring.cloud.function.rsocket-org.springframework.cloud.function.rsocket.RSocketFunctionProperties, spring.cloud.function.web.export-org.springframework.cloud.function.web.source.ExporterProperties, spring.cloud.gateway.loadbalancer-org.springframework.cloud.gateway.config.GatewayLoadBalancerProperties, spring.cloud.gateway.metrics-org.springframework.cloud.gateway.config.GatewayMetricsProperties, spring.cloud.refresh-org.springframework.cloud.autoconfigure.RefreshAutoConfiguration$RefreshProperties, spring.cloud.service-registry.auto-registration-org.springframework.cloud.client.serviceregistry.AutoServiceRegistrationProperties, spring.codec-org.springframework.boot.autoconfigure.codec.CodecProperties, spring.info-org.springframework.boot.autoconfigure.info.ProjectInfoProperties, spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties, spring.lifecycle-org.springframework.boot.autoconfigure.context.LifecycleProperties, spring.netty-org.springframework.boot.autoconfigure.netty.NettyProperties, spring.rsocket-org.springframework.boot.autoconfigure.rsocket.RSocketProperties, spring.sql.init-org.springframework.boot.autoconfigure.sql.init.SqlInitializationProperties, spring.task.execution-org.springframework.boot.autoconfigure.task.TaskExecutionProperties, spring.task.scheduling-org.springframework.boot.autoconfigure.task.TaskSchedulingProperties, spring.web-org.springframework.boot.autoconfigure.web.WebProperties, spring.webflux-org.springframework.boot.autoconfigure.web.reactive.WebFluxProperties, spring.webflux.multipart-org.springframework.boot.autoconfigure.web.reactive.ReactiveMultipartProperties, springApplicationAdminRegistrar, springBootVersionVerifier, standardJacksonObjectMapperBuilderCustomizer, startupTimeMetrics, stringToZonedDateTimeConverter, stripPrefixGatewayFilterFactory, taskExecutorBuilder, taskSchedulerBuilder, transferEncodingNormalizationHeadersFilter, uptimeMetrics, viewResolutionResultHandler, webClientBuilder, webEndpointDiscoverer, webEndpointPathMapper, webEndpointReactiveHandlerMapping, webExposeExcludePropertyEndpointFilter, webFluxAdapterRegistry, webFluxContentTypeResolver, webFluxConversionService, webFluxTagsProvider, webFluxValidator, webFluxWebSocketHandlerAdapter, webHandler, webServerFactoryCustomizerBeanPostProcessor, webSessionIdResolver, webSessionManager, webSocketService, webfluxMetrics, websocketRoutingFilter, weightCalculatorWebFilter, weightRoutePredicateFactory, welcomePageRouterFunctionMapping, xForwardedHeadersFilter, xForwardedRemoteAddrRoutePredicateFactory] 2022-04-04 22:56:16.502 INFO 6660 --- [ main] o.s.cloud.context.scope.GenericScope : BeanFactory id=d947dbd3-9b88-33a6-9fef-51c1d353929e 2022-04-04 22:56:16.959 DEBUG 6660 --- [ main] o.s.c.gateway.config.GatewayProperties : Routes supplied from Gateway Properties: [RouteDefinition{id='bridge', predicates=[PredicateDefinition{name='Path', args={_genkey_0=/verify}}], filters=[], uri=forward:/verification-service/verify, order=0, metadata={}}] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [After] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Before] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Between] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Cookie] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Header] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Host] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Method] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Path] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Query] 2022-04-04 22:56:17.115 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [ReadBody] 2022-04-04 22:56:17.116 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [RemoteAddr] 2022-04-04 22:56:17.116 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [XForwardedRemoteAddr] 2022-04-04 22:56:17.116 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [Weight] 2022-04-04 22:56:17.116 INFO 6660 --- [ main] o.s.c.g.r.RouteDefinitionRouteLocator : Loaded RoutePredicateFactory [CloudFoundryRouteService] 2022-04-04 22:56:17.327 INFO 6660 --- [ main] o.s.c.f.web.flux.FunctionHandlerMapping : FunctionCatalog: org.springframework.cloud.function.context.catalog.BeanFactoryAwareFunctionRegistry@f2276c9 2022-04-04 22:56:17.352 INFO 6660 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator' 2022-04-04 22:56:17.409 WARN 6660 --- [ main] onfigReactiveWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'functionRSocketMessageHandler' defined in class path resource [org/springframework/cloud/function/rsocket/RSocketAutoConfiguration.class]: Unsatisfied dependency expressed through method 'functionRSocketMessageHandler' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration': Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'brokerClientRSocketRequester' defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'brokerClientRSocketRequester' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'brokerRSocketRequesterBuilder' defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class]: Unsatisfied dependency expressed through method 'brokerRSocketRequesterBuilder' parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'functionRSocketConnectorConfigurer' defined in class path resource [org/springframework/cloud/function/rsocket/RSocketRoutingAutoConfiguration.class]: Unsatisfied dependency expressed through method 'functionRSocketConnectorConfigurer' parameter 0; nested exception is org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'functionRSocketMessageHandler': Requested bean is currently in creation: Is there an unresolvable circular reference? 2022-04-04 22:56:17.438 INFO 6660 --- [ main] ConditionEvaluationReportLoggingListener :

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2022-04-04 22:56:17.459 ERROR 6660 --- [ main] o.s.b.d.LoggingFailureAnalysisReporter :


APPLICATION FAILED TO START


Description:

The dependencies of some of the beans in the application context form a cycle:

┌─────┐ | functionRSocketMessageHandler defined in class path resource [org/springframework/cloud/function/rsocket/RSocketAutoConfiguration.class] ↑ ↓ | io.rsocket.broker.http.bridge.config.RSocketHttpBridgeAutoConfiguration ↑ ↓ | brokerClientRSocketRequester defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class] ↑ ↓ | brokerRSocketRequesterBuilder defined in class path resource [io/rsocket/broker/client/spring/BrokerClientAutoConfiguration.class] ↑ ↓ | functionRSocketConnectorConfigurer defined in class path resource [org/springframework/cloud/function/rsocket/RSocketRoutingAutoConfiguration.class] └─────┘

Action:

Relying upon circular references is discouraged and they are prohibited by default. Update your application to remove the dependency cycle between beans. As a last resort, it may be possible to break the cycle automatically by setting spring.main.allow-circular-references to true.

Process finished with exit code 1

OlgaMaciaszek commented 2 years ago

Thanks, @sachins-dev - I get it now. That was working previously. Maybe sth has changed in upstream dependencies. Will take a look.