Skip to content

Actuator startup endpoint fails to serialize JSON when field visibility is set to 'any' #32297

@iaptekar

Description

@iaptekar

I have a demo project using Spring Boot 2.7.3. The only dependencies are the web and actuator starters. I try to start the application with a BufferingApplicationStartup and set management.endpoints.web.exposure.include=* in application.properties. This goes well and I can access startup metrics at /actuator/startup.

However, if I add the property spring.jackson.visibility.field=any to application.properties and hit the actuator/startup endpoint I get the following error:

com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.Clock$SystemClock` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: org.springframework.boot.actuate.startup.StartupEndpoint$StartupResponse["timeline"]
->org.springframework.boot.context.metrics.buffering.StartupTimeline["events"]
->java.util.Collections$UnmodifiableRandomAccessList[0]
->org.springframework.boot.context.metrics.buffering.StartupTimeline$TimelineEvent["step"]
->org.springframework.boot.context.metrics.buffering.BufferedStartupStep["recorder"]
->org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup$$Lambda$62/0x0000000800c384d8["arg$1"]
->org.springframework.boot.context.metrics.buffering.BufferingApplicationStartup["clock"])
	at com.fasterxml.jackson.databind.exc.InvalidDefinitionException.from(InvalidDefinitionException.java:77) ~[jackson-databind-2.13.3.jar:2.13.3]
	at com.fasterxml.jackson.databind.SerializerProvider.reportBadDefinition(SerializerProvider.java:1300) ~[jackson-databind-2.13.3.jar:2.13.3]
...

None of the other spring.jackson properties I tried caused this error. Is there perhaps an issue with the ObjectMapper initialization for the startup actuator?

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: supersededAn issue that has been superseded by another

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions