grpc-spring icon indicating copy to clipboard operation
grpc-spring copied to clipboard

Facing Dependency Error on Spring Boot 3 Update

Open adi-wtag opened this issue 2 years ago • 4 comments

The context

I am trying to update my project on Spring boot 3 that has a dependency on latest grpc starter module.

The question

I am facing a circular dependency error.

Sample Code

@Configuration
@GrpcClientBeans({
  @GrpcClientBean(clazz = CSBlockingStub.class, client = @GrpcClient("rc"))
})
class GrpcStubConfig {
  @Bean
  public CSBlockingStub csBlockingStub(CSBlockingStub stub) {
    return stub;
  }
}

The application's environment

Which versions do you use?

  • Spring (boot): 3.0.0
  • grpc-java: 1.51.1
  • grpc-spring-boot-starter: 2.14.0.RELEASE
  • java: version + architecture (64bit?) 17 + 64bit

Additional information

  • Did it ever work before?

It was working fine on spring boot 2.7.*

Error Message https://github.com/yidongnan/grpc-spring-boot-starter/issues/810#issuecomment-1359289765

adi-wtag avatar Dec 20 '22 08:12 adi-wtag

Please include the error message, so that I know which bean/dependency and where.

ST-DDT avatar Dec 20 '22 09:12 ST-DDT

The dependencies of some of the beans in the application context form a cycle:
┌─────┐
|  csBlockingStub defined in class path resource [../GrpcStubConfig.class]
└─────┘

adi-wtag avatar Dec 20 '22 12:12 adi-wtag

@ST-DDT If I use https://github.com/yidongnan/grpc-spring-boot-starter/commit/5853d23f984dfedd19a560ef18aa42eadd46fe44 latest commit instead of latest release, there is no such error. Could you please help me understanding the situation ? Will there be any new release asap ?

adi-wtag avatar Dec 20 '22 13:12 adi-wtag

@adi-wtag attach the complete error stack, not just the error message.

rahul-raj avatar Jan 24 '23 17:01 rahul-raj