java.lang.ClassNotFoundException: io.micrometer.core.instrument.stats.quantile.Quantiles

See original GitHub issue

Getting java.lang.ClassNotFoundException: io.micrometer.core.instrument.stats.quantile.Quantiles exception when using spring-boot-actuator-starter and setting up a data source.

version used: org.springframework.boot.spring-boot-starter-actuator:2.1.7.RELEASE

also worth noting: As a transitive dependency, I already load io.micrometer.micrometer-registry-prometheus:1.1.1

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration$HikariDataSourceM$
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:380)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1411)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:592)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:515)
        at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:320)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
        at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:318)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:845)
        at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:877)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:549)
        at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:743)
        at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:390)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:312)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1214)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1203)
        at com.getbux.broker.backoffice.app.App.main(App.java:14)
Caused by: java.lang.NoClassDefFoundError: io/micrometer/core/instrument/stats/quantile/Quantiles
        at com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory.create(MicrometerMetricsTrackerFactory.java:20)
        at com.zaxxer.hikari.pool.HikariPool.setMetricsTrackerFactory(HikariPool.java:286)
        at com.zaxxer.hikari.HikariDataSource.setMetricsTrackerFactory(HikariDataSource.java:243)
        at org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration$HikariDataSourceMetricsConfiguration.bindMetricsRegistryToHikariDataSource(DataSourcePoolMetri$
        at org.springframework.boot.actuate.autoconfigure.metrics.jdbc.DataSourcePoolMetricsAutoConfiguration$HikariDataSourceMetricsConfiguration.bindMetricsRegistryToHikariDataSources(DataSourcePoolMetr$
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:708)
        at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:90)
        at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:374)
        ... 17 common frames omitted
Caused by: java.lang.ClassNotFoundException: io.micrometer.core.instrument.stats.quantile.Quantiles
        at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
        at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
        at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
        ... 29 common frames omitted

Does anyone have a clue what I am doing wrong, or how to fix this exception?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
gorjan-buxcommented, Aug 29, 2019

I was using:

        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>2.7.2</version>
        </dependency>

now I switched to:

        <dependency>
            <groupId>com.zaxxer</groupId>
            <artifactId>HikariCP</artifactId>
            <version>3.3.1</version>
        </dependency>

which seems to have solved the problem.

Thanks for your help guys, I appreciate it.

0reactions
shakuzencommented, Aug 29, 2019

For some reason we are using a custom version HikariCP, and I will investigate this further and post an update.

Micrometer integration should work well with official versions of HikariCP. Your stacktrace doesn’t match with the HikariCP source: https://github.com/brettwooldridge/HikariCP/blob/086bf18389282d1a7484e243d6af49890cec4fd7/src/main/java/com/zaxxer/hikari/metrics/micrometer/MicrometerMetricsTrackerFactory.java

If you can use official versions of HikariCP, that would be best.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to start micrometer with spring boot? - Stack Overflow
This is a classpath error. In your stack trace it appears that you are running Spring Boot 2.2.0.RELEASE. According to this documentation: ...
Read more >
io.micrometer.core.instrument.stats.quantile.Quantiles
Here you can download the dependencies for the java class io.micrometer.core.instrument.stats.quantile.Quantiles. Use this engine to looking through the ...
Read more >
SDK PIM 10 HF2 Micrometer Error - Informatica Network
Hi, during the starting of SDK 10 HF 2, the log write the following error. I tried to disable the micrometer logs from...
Read more >
Micrometer Core - Maven Repository
Micrometer Core. Core module of Micrometer containing instrumentation API and implementation. License, Apache 2.0. Categories, Application Metrics.
Read more >
Error with com.rabbitmq:amqp-client:5.2.0 dependency
Exception in thread "main" java.lang.TypeNotPresentException: Type io.micrometer.core.instrument.MeterRegistry not present at sun.invoke.util.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found