Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude correct HikariCP version #16489

Closed
pse-sonic opened this issue Apr 8, 2019 · 16 comments
Closed

Exclude correct HikariCP version #16489

pse-sonic opened this issue Apr 8, 2019 · 16 comments
Labels
status: superseded An issue that has been superseded by another type: bug A general bug

Comments

@pse-sonic
Copy link

Hello,

Spring Boot 2.1.4-RELEASE uses Quartz 2.3.1 which contains hikaricp-java7 (since this release - see quartz-scheduler/quartz#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

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Apr 8, 2019
@snicoll snicoll added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Apr 8, 2019
@snicoll snicoll added this to the 2.1.5 milestone Apr 8, 2019
@ielatif
Copy link
Contributor

ielatif commented Apr 8, 2019

Is this open for contribution? I would be happy to contribute if @pse-sonic don't mind

@pse-sonic
Copy link
Author

Feel free to solve this issue :)

@snicoll
Copy link
Member

snicoll commented Apr 8, 2019

@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.

@ielatif
Copy link
Contributor

ielatif commented Apr 8, 2019

This is similar to this one #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?

@snicoll
Copy link
Member

snicoll commented Apr 8, 2019

@ielatif it's already using HikariCP most probably. If you managed to reproduce the error in a test, feel free to submit something.

@thackel
Copy link

thackel commented Apr 8, 2019

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.

@peterssond
Copy link

Is there a workaround for this issue, or should I stay on 2.1.3?

@snicoll
Copy link
Member

snicoll commented Apr 9, 2019

You can exclude the dependency yourself in your project for the time being.

@ielatif
Copy link
Contributor

ielatif commented Apr 9, 2019

PR #16502

@snicoll
Copy link
Member

snicoll commented Apr 15, 2019

Closing in favour of PR #16502

@oneiros-de
Copy link

oneiros-de commented Jun 5, 2019

For me this is not solved with 2.1.5 and quartz 2.3.1 - the startup still fails with the error.

@wilkinsona
Copy link
Member

@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.

@oridool
Copy link

oridool commented Jul 27, 2020

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...

@wilkinsona
Copy link
Member

wilkinsona commented Jul 28, 2020

Thanks for letting us know, @oridool. This is a bug in the dependency management plugin that the changes made for #21911 have exposed. I've opened spring-gradle-plugins/dependency-management-plugin#281.

@oridool
Copy link

oridool commented Jul 28, 2020

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?

@wilkinsona
Copy link
Member

Right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: superseded An issue that has been superseded by another type: bug A general bug
Projects
None yet
Development

No branches or pull requests

9 participants