spring-boot: java.lang.NoClassDefFoundError: org/LatencyUtils/IntervalEstimator in Springboot 2.3.0

Springboot 2.3.0 application start failed when enabling actuator by add dependency of spring-boot-starter-actuator.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourc
ePoolMetricsAutoConfiguration$HikariDataSourceMetricsConfiguration': Injection of autowired dependencies failed; nested exception is java.lang.NoClassDefFoun
dError: org/LatencyUtils/IntervalEstimator
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:
405) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1422) ~[spring-b
eans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-be
ans-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517) ~[spring-bean
s-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323) ~[spring-beans-5.2.6.RELEASE.jar:5.
2.6.RELEASE]
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226) ~[spring-beans-5.2.6.RE
LEASE.jar:5.2.6.RELEASE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEA
SE]
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.6.RELEASE.jar:5.2.6.RELEASE
]
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:895) ~[spring-beans-
5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:878) ~[spring-conte
xt-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:550) ~[spring-context-5.2.6.RELEASE.jar:5.2.6.RELEASE]
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758) ~[spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:315) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) [spring-boot-2.3.0.RELEASE.jar:2.3.0.RELEASE]
        at com.test.MainApp.main(MainApp.java:19) [starter-0.0.1.jar:?]
Caused by: java.lang.NoClassDefFoundError: org/LatencyUtils/IntervalEstimator
        at io.micrometer.core.instrument.simple.SimpleMeterRegistry.newTimer(SimpleMeterRegistry.java:90) ~[micrometer-core-1.5.1.jar:1.5.1]
        at io.micrometer.core.instrument.MeterRegistry.lambda$timer$2(MeterRegistry.java:308) ~[micrometer-core-1.5.1.jar:1.5.1]
        at io.micrometer.core.instrument.MeterRegistry.getOrCreateMeter(MeterRegistry.java:612) ~[micrometer-core-1.5.1.jar:1.5.1]
        at io.micrometer.core.instrument.MeterRegistry.registerMeterIfNecessary(MeterRegistry.java:566) ~[micrometer-core-1.5.1.jar:1.5.1]
        at io.micrometer.core.instrument.MeterRegistry.timer(MeterRegistry.java:306) ~[micrometer-core-1.5.1.jar:1.5.1]
        at io.micrometer.core.instrument.Timer$Builder.register(Timer.java:539) ~[micrometer-core-1.5.1.jar:1.5.1]

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

@yuanpli org.latencyutils:LatencyUtils jar file seems to be corrupted somehow. Deleting it from build cache and rebuilding the project will work if that’s the case.

I think this should be re-opened. I didn’t understand what yanpli’s resolution was.

I encountered this issue upgrading an existing project to 2.3.0 and was only able to resolve it by reverting to 2.2.6.

Including the missing dependency did not resolve the issue.

Have you added the actuator dependency?

Yes. Please run the project from the command line (mvn spring-boot:run) as I suspect your IDE configuration is broken. This issue tracker is not the right place to get support on that though.