Hello,
Spring Boot 2.1.4-RELEASE uses Quartz 2.3.1 which contains hikaricp-java7 (since this release - see https://github.com/quartz-scheduler/quartz/issues/294) but the spring-boot-dependencies POM still excludes hikaricp-java6.
This causes an AbstractMethodError when using HikariCP and Quartz together.
Caused by: java.lang.AbstractMethodError: Receiver class com.zaxxer.hikari.metrics.micrometer.MicrometerMetricsTrackerFactory does not define or inherit an implementation of the resolved method abstract create(Ljava/lang/String;Lcom/zaxxer/hikari/metrics/PoolStats;)Lcom/zaxxer/hikari/metrics/MetricsTracker; of interface com.zaxxer.hikari.metrics.MetricsTrackerFactory.
Best regards Sebastian
Comment From: ielatif
Is this open for contribution? I would be happy to contribute if @pse-sonic don't mind
Comment From: pse-sonic
Feel free to solve this issue :)
Comment From: snicoll
@ielatif fixing the issue is easy but I'd like to put something in place so that our build fails the next time this happens. If you want to give that a try, feel free to go ahead.
Comment From: ielatif
This is similar to this one https://github.com/spring-projects/spring-boot/issues/12364
There is tests for Quartz in QuartzAutoConfigurationTests. We can add a new test withHikariCPDataSource to integrate HikariCP and Quartz. @snicoll What do you think?
Comment From: snicoll
@ielatif it's already using HikariCP most probably. If you managed to reproduce the error in a test, feel free to submit something.
Comment From: thackel
Additionally the project should really set up a duplicate classpath check for a maximum possible amount of dependencies (all starters for example). This would avoid such kind of issues in the future.
Comment From: peterssond
Is there a workaround for this issue, or should I stay on 2.1.3?
Comment From: snicoll
You can exclude the dependency yourself in your project for the time being.
Comment From: ielatif
PR https://github.com/spring-projects/spring-boot/pull/16502
Comment From: snicoll
Closing in favour of PR #16502
Comment From: oneiros-de
For me this is not solved with 2.1.5 and quartz 2.3.1 - the startup still fails with the error.
Comment From: wilkinsona
@oneiros-de This issue applied specifically to a com.zaxxer:HikariCP-*
dependency being pulled in via Quartz. You may have such a dependency coming from somewhere else. If you'd like us to investigate, please open a new issue with a minimal sample that reproduces the problem.
Comment From: oridool
I'm using latest springboot 2.3.2, and have the same issue mentioned above.
With springboot 2.3.1 , I didn't get this error. As a workaround I added to my dependency:
implementation ('org.springframework.boot:spring-boot-starter-quartz') {
exclude group: 'com.zaxxer', module: 'HikariCP-java7'
// workaround for https://github.com/spring-projects/spring-boot/issues/16489
}
Before this exclusion, I had the following dependencies:
+--- org.springframework.boot:spring-boot-starter-quartz -> 2.3.2.RELEASE
| +--- org.springframework.boot:spring-boot-starter:2.3.2.RELEASE (*)
| +--- org.springframework:spring-context-support:5.2.8.RELEASE (*)
| +--- org.springframework:spring-tx:5.2.8.RELEASE (*)
| \--- org.quartz-scheduler:quartz:2.3.2
| +--- com.mchange:mchange-commons-java:0.2.15
| +--- **com.zaxxer:HikariCP-java7:2.4.13**
| | \--- org.slf4j:slf4j-api:1.7.21 -> 1.7.30
| \--- org.slf4j:slf4j-api:1.7.7 -> 1.7.30
I'm not sure if that is an issue related to Quartz or to SpringBoot...
Comment From: wilkinsona
Thanks for letting us know, @oridool. This is a bug in the dependency management plugin that the changes made for https://github.com/spring-projects/spring-boot/issues/21911 have exposed. I've opened https://github.com/spring-gradle-plugins/dependency-management-plugin/issues/281.
Comment From: oridool
Thank you @wilkinsona for the fast fix. I assume it will be available with io.spring.dependency-management gradle plugin Version 1.0.10.RELEASE . Right?
Comment From: wilkinsona
Right.