I am facing this below issue, while i am using 2.6.8 spring version as well actuator version is same. When I exclude HealthAutoConfiguration class then this exceoption has been fixed but health and other actuator end point cannot work.

Properties for actuator

management.health.livenessState.enabled=true
management.health.readinessState.enabled=true
management.endpoint.health.group.readiness.include=readinessState,db,diskSpace
management.endpoint.health.group.liveness.include=livenessState,db,diskSpace
management.endpoint.liquibase.enabled=false
management.endpoints.web.base-path=/
management.endpoints.web.exposure.include=health,prometheus
management.endpoints.web.path-mapping.prometheus=metrics
management.server.port=9095

Exception

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'healthEndpointWebFluxHandlerMapping' defined in class path resource [org/springframework/boot/actuate/autoconfigure/health/HealthEndpointReactiveWebExtensionConfiguration$WebFluxAdditionalHealthEndpointPathsConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.boot.actuate.endpoint.web.reactive.AdditionalHealthEndpointPathsWebFluxHandlerMapping]: Factory method 'healthEndpointWebFluxHandlerMapping' threw exception; nested exception is java.lang.IllegalStateException: Found multiple extensions for the endpoint bean healthEndpoint (healthEndpointWebExtension, reactiveHealthEndpointWebExtension)
        at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:658)

Comment From: philwebb

HealthEndpointWebExtensionConfiguration is guarded by @ConditionalOnWebApplication(type = Type.SERVLET) and HealthEndpointReactiveWebExtensionConfiguration has @ConditionalOnWebApplication(type = Type.REACTIVE) so it shouldn't be possible for both beans to exist at the same time.

@haseebahmed Can you please share a sample project that reproduces the issue. You can either attach a zip file to this issue or share a link to a GitHub project.

Comment From: asadyarkhan007

How do these conditions become true? Like these two classes exist in actuator:2.6.8 Now on what setting/configuration/dependency/jar its type set to Servlet or Reactive automatically since we have not defined it anywhere explicitly?

Comment From: snicoll

@asadyarkhan007 I don't know if you're trying to help @haseebahmed but we need a sample project before going forward here.

Comment From: asadyarkhan007

We are working on the same project. Since it is a client project we will try to extract and provide you sample project. But if you could answer the above we might be able to solve it beforehand.

Comment From: snicoll

I don't think answering that question would help you. You can run your app with -Ddebug to get the auto-configuration report and understand where those two beans come from. Perhaps this project contributes a healthEndpointWebExtension? We can't really justify spending time on this without the sample.

Comment From: asadyarkhan007

Sure will provide soon.

Comment From: haseebahmed

Sure I will try to replicate this issue in my sample project.

Comment From: spring-projects-issues

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Comment From: spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.