HikariCP icon indicating copy to clipboard operation
HikariCP copied to clipboard

Version 4 depends on Alpha Version of SLF4J

Open janhicken opened this issue 3 years ago • 7 comments

Hello,

since the latest major release of version 4.x.x, the dependency to slf4j-api uses version 2.0.0-alpha.

This is problematic, because the version is still unstable and also is binary incompatible to any 1.x.x bindings of SLF4J.

My current workaround is to set the version of slf4j-api explicitly using <dependencyManagement>.

janhicken avatar Mar 01 '21 11:03 janhicken

This is in fact a problem and I assume @brettwooldridge did it for the same reasons as Jetty - the modularity stuff doesn't play nice with 1.7.x

mikebell90 avatar Mar 18 '21 16:03 mikebell90

Is there any way to resolve this apart from 1) using unstable slf4j-api or 2) pinning HikariCP to a version prior to this change?

hoxu avatar Apr 21 '21 06:04 hoxu

@hoxu Yes there is, just exclude the org:slf4j:slf4j-api dependency when including HikariCP or pin the slf4j-api version using dependencyManagement

janhicken avatar Apr 21 '21 07:04 janhicken

For deps.edn, I ended up using the following:

com.zaxxer/HikariCP
{:mvn/version "4.0.3" :exclusions [org.slf4j/slf4j-api]

hoxu avatar Apr 23 '21 08:04 hoxu

Hi @brettwooldridge,

We're in a kind of blocked situation today because of HikariCP.

Lots of libraries using HikariCP, like doobie or Quill (in the Scala world) for example, can't update to the v4 nor v5 versions of HikariCP because of the SFL4J version used (2.0.0-alpha1) but, when using JLink to package our apps, we need the v4 or v5 of HikariCP otherwise we end up with the following error that prevent us to build our apps:

> jdeps --multi-release 11 -R <classpath>

 Exception in thread "main" java.lang.module.FindException: Module hibernate.core not found, required by com.zaxxer.hikari

What can we do to move forward to fix this issue? 🤔 Can we maybe rollback the update of SLF4J to go back to the v1.7.x in the v5 branch of Hikari? 🤔

For now, the only "fix" we have as users is to use the version 3.4.3 of HikariCP which doesn't contain the "problematic" changes made in 3.4.4. 😕

guizmaii avatar Aug 30 '21 06:08 guizmaii

Hi @brettwooldridge,

We're in a kind of blocked situation today because of HikariCP.

Lots of libraries using HikariCP, like doobie or Quill (in the Scala world) for example, can't update to the v4 nor v5 versions of HikariCP because of the SFL4J version used (2.0.0-alpha1) but, when using JLink to package our apps, we need the v4 or v5 of HikariCP otherwise we end up with the following error that prevent us to build our apps:

> jdeps --multi-release 11 -R <classpath>

 Exception in thread "main" java.lang.module.FindException: Module hibernate.core not found, required by com.zaxxer.hikari

What can we do to move forward to fix this issue? Can we maybe rollback the update of SLF4J to go back to the v1.7.x in the v5 branch of Hikari?

For now, the only "fix" we have as users is to use the version 3.4.3 of HikariCP which doesn't contain the "problematic" changes made in 3.4.4.

You can exclude it like ("org.tpolecat" %% "doobie-quill" % V.Doobie).exclude("org.slf4j", "*")

apavlychev avatar Sep 23 '21 13:09 apavlychev

org.slf4j/slf4j-api {:mvn/version "2.0.0"} was released: https://mvnrepository.com/artifact/org.slf4j/slf4j-api

Maybe HikariCP could be updated to it, since it is at least a stable version?

devurandom avatar Aug 31 '22 10:08 devurandom

Please, upgrade to ^2.0.0 as we are getting Receiver class org.apache.logging.slf4j.SLF4JServiceProvider does not define or inherit an implementation of the resolved method 'abstract java.lang.String getRequesteApiVersion()' of interface org.slf4j.spi.SLF4JServiceProvider. when trying to combine it with log4j-slf4j2-impl. Changing the version to 2.0.3 fixes the issue.

astappiev avatar Oct 12 '22 13:10 astappiev

HikariCP 5 is still using the alpha version of slf4j with JDK 11+.

If it really is necessary for some reason, then update to an actual release. Otherwise stick with 1.7.x for all releases.

OrangeDog avatar Jan 05 '23 11:01 OrangeDog