HikariCP
HikariCP copied to clipboard
Version 4 depends on Alpha Version of SLF4J
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>
.
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
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 Yes there is, just exclude the org:slf4j:slf4j-api
dependency when including HikariCP or pin the slf4j-api
version using dependencyManagement
For deps.edn
, I ended up using the following:
com.zaxxer/HikariCP
{:mvn/version "4.0.3" :exclusions [org.slf4j/slf4j-api]
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
. 😕
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 thev5
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 in3.4.4
.
You can exclude it like
("org.tpolecat" %% "doobie-quill" % V.Doobie).exclude("org.slf4j", "*")
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?
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.
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.