Skip to content

Exposing gRPC test server port should backoff if gRPC is not present #50825

Description

@nealeu

Direct upgrade from 4.0.6 results in some GRPC features being enabled despite no active choice or the relevant classes being available:

Image

The following exception is encountered via GrpcPortInfoApplicationContextInitializer in spring-boot-grpc-test.

Caused by: java.lang.TypeNotPresentException: Type org.springframework.grpc.server.lifecycle.GrpcServerStartedEvent not present
	at java.base/java.lang.Class.getGenericInterfaces(Class.java:1278)
	at org.springframework.core.ResolvableType.getInterfaces(ResolvableType.java:544)
	at org.springframework.core.ResolvableType.as(ResolvableType.java:492)
	at org.springframework.context.event.GenericApplicationListenerAdapter.resolveDeclaredEventType(GenericApplicationListenerAdapter.java:112)

Given the involvment of spring-boot-starter-test-classic, I suspect this is that this was added to the -classic module dependencies, which has resulted in a "Gotcha!".

Image

Workaround

Exclude spring-boot-grpc-test or migrate from using -classic dependencies.

Possible fix

Revert addition of grpc to classic jars, or update release notes to point out the gotcha of using classic wrt addition of grpc.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions