Skip to content

OkapiMicrometerAutoConfiguration throws NoClassDefFoundError when okapi-micrometer is absent but MeterRegistry is present #84

Description

@rawo

OkapiMicrometerAutoConfiguration's @ConditionalOnClass only guards on io.micrometer.core.instrument.MeterRegistry, not on any class from okapi-micrometer itself. Since MeterRegistry commonly arrives via Spring Boot Actuator independently of okapi-micrometer, an app with Actuator but without the okapi-micrometer dependency hits NoClassDefFoundError at context startup, because the autoconfiguration class directly references MicrometerOutboxListener/MicrometerOutboxMetrics/OutboxMetricsRefresher.

Fix: add MicrometerOutboxListener to the class-level @ConditionalOnClass, so the whole autoconfiguration is skipped (not just attempted and failed) when okapi-micrometer isn't on the classpath.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions