【spring boot】【spring cloud】异常:找不到方法HikariDataSource.getMetricsTrackerFactory()

错误

Caused by: java.lang.NoSuchMethodError: com.zaxxer.hikari.HikariDataSource.getMetricsTrackerFactory()Lcom/zaxxer/hikari/metrics/MetricsTrackerFactory;
at org.springframework.boot.actuate.autoconfigure.metrics.jdbc.HikariDataSourceMetricsPostProcessor.bindMetricsRegistryToHikariDataSource(HikariDataSourceMetricsPostProcessor.java:61)
at org.springframework.boot.actuate.autoconfigure.metrics.jdbc.HikariDataSourceMetricsPostProcessor.postProcessAfterInitialization(HikariDataSourceMetricsPostProcessor.java:52)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:438)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1714)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:583)
… 101 common frames omitted

异常解决

去掉 spring-boot-starter-quartz 后,问题解决

		
			org.springframework.boot
			spring-boot-starter-quartz
		

分析

  • 应该是spring boot和spring cloud版本兼容问题。
  • spring cloud 版本 : Finchley.RELEASE
  • spring boot 版本: 2.0.0.RELEASE

你可能感兴趣的:(spring-boot)