grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.53k stars 830 forks source link

Spring Framework BeanPostProcessorChecker: warning logs about BeanPostProcessors #1130

Open space88man opened 3 months ago

space88man commented 3 months ago

The context Spring Framework's BeanPostProcessorChecker has started to complain loudly (logs at WARN level) about the BeanPostProcessors in this repo.

Creating a Spring Boot application that hosts a gRPC server and uses multiple gRPC client stubs to access services. Spring Boot version: 3.3.2

Both client and server auto-configurations classes trigger the checker. The bug

Warnings:

2024-07-31T10:19:01 WARNING [main] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'net.d
evh.boot.grpc.client.autoconfigure.GrpcClientAutoConfiguration' of type [net.devh.boot.grpc.client.autoconfigure.GrpcClientAutoConfiguration]
 is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly 
injected into a currently created BeanPostProcessor [grpcClientBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and 
its dependencies.

2024-07-31T10:19:01 WARNING [main] org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'net.d
evh.boot.grpc.server.autoconfigure.GrpcServerAutoConfiguration' of type [net.devh.boot.grpc.server.autoconfigure.GrpcServerAutoConfiguration]
 is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly 
injected into a currently created BeanPostProcessor [grpcClientBeanPostProcessor]? Check the corresponding BeanPostProcessor declaration and 
its dependencies. 

Stacktrace and logs

N/A - application does start up Steps to Reproduce

The application's environment

Which versions do you use?

Additional context

space88man commented 3 months ago

Not specific to this repo: I am seeing this warning for other autoconfiguration classes. E.g https://github.com/spring-projects/spring-boot/issues/38558. It's not a Spring Boot issue but due to changes in Spring Framework https://github.com/spring-projects/spring-boot/issues/39224#issuecomment-1896635329

Electric-impala commented 3 months ago

I also encountered same issue. How can we get rid off these warn logs? @space88man did you got any solution

anandrathnauni commented 1 month ago

I was using the following

implementation 'net.devh:grpc-server-spring-boot-starter:3.1.0.RELEASE'
implementation 'net.devh:grpc-client-spring-boot-starter:3.1.0.RELEASE'

I had to downgrade them

implementation 'net.devh:grpc-server-spring-boot-starter:3.0.0.RELEASE'
implementation 'net.devh:grpc-client-spring-boot-starter:3.0.0.RELEASE'

Also had the following strictly on specific versions

    implementation('io.grpc:grpc-api') {
        version {
            strictly '1.63.0'
        }
    }
    implementation('io.grpc:grpc-protobuf') {
        version {
            strictly '1.63.0'
        }
    }

    implementation('io.grpc:grpc-stub') {
        version {
            strictly '1.63.0'
        }
    }

    implementation('org.springframework:spring-webmvc') {
        version {
            strictly '6.1.13'
        }
    }