Skip to content

RSocket's EmbeddedServerAutoConfiguration does not back off if spring-web is absent #25551

@olegz

Description

@olegz

RSocket integration in spring-cloud-function has no dependency on anything web, yet spring-boot-starter-rsocket brings spring-web into the classpath. Trying to exclude it results in variety of classpath errors which are easily fixable until the EmbeddedServerAutoConfiguration issue (see stack trace below)

Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.springframework.boot.autoconfigure.rsocket.RSocketServerAutoConfiguration$EmbeddedServerAutoConfiguration.reactorResourceFactory
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.deducedBeanTypeForBeanMethod(OnBeanCondition.java:517) ~[spring-boot-autoconfigure-2.4.3.jar:2.4.3]
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.deducedBeanType(OnBeanCondition.java:506) ~[spring-boot-autoconfigure-2.4.3.jar:2.4.3]
	at org.springframework.boot.autoconfigure.condition.OnBeanCondition$Spec.<init>(OnBeanCondition.java:429) ~[spring-boot-autoconfigure-2.4.3.jar:2.4.3]
	... 85 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.springframework.http.client.reactive.ReactorResourceFactory
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[na:1.8.0_252]

After briefly discussing it with @wilkinsona there seems to be a missing condition for backing-off EmbeddedServerAutoConfiguration if certain dependencies are not present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions