1

I try to enable Spring Boot Actuator (together with Swagger) and have in the pom.xml

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
        <version>2.4.5</version>
    </dependency>

with the following config in the yml-file:

springdoc:
  api-docs:
    enabled: true
  show:
    actuator: true  


management:
  endpoints:
    web:
      exposure:
        include= "*"
      expose: "*"

When I launch it I get the following exception:

***************************
APPLICATION FAILED TO START
***************************

Description:

Failed to bind properties under 'management.endpoints.web.exposure' to org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties$Exposure:

    Reason: No converter found capable of converting from type [java.lang.String] to type [org.springframework.boot.actuate.autoconfigure.endpoint.web.WebEndpointProperties$Exposure]

Action:

Update your application's configuration

How to fix this Exception?

LeO
  • 4,238
  • 4
  • 48
  • 88
  • seems to me that your yaml definition is incorrect, `include= "*"` should be `include: "*"`. EDIT: refer to first answer, thus why it was resolved as String value and could not be mapped correctly by Spring Boot Actuator – NicolasG May 05 '21 at 08:45

2 Answers2

4

Your YAML has a = instead of a :

And remove expose:

Wrong:

management:
  endpoints:
    web:
      exposure:
        include= "*"
      expose: "*"

Correct:

management:
  endpoints:
    web:
      exposure:
        include: "*"
Simon Martinelli
  • 34,053
  • 5
  • 48
  • 82
  • The one problem solved - another appeared. You have as well an idea how to fix https://stackoverflow.com/q/67398310/325868? – LeO May 05 '21 at 09:10
0

My issue was fixed by adding following Maven dependency

        <dependency>
          <groupId>org.springframework.boot</groupId>
          <artifactId>spring-boot-actuator-autoconfigure</artifactId>
        </dependency>
Khalid Habib
  • 1,100
  • 1
  • 16
  • 25