Maven does not resolve hibernate-c3p0 dependency on slf4j

When I include hibernate-c3p0Maven in my file pom.xml, I get runtime NoClassDefFoundErrorbecause it cannot find org.slf4j.impl.StaticLoggerBinder. It seemed to me that Maven would resolve this dependency - therefore, if c3p0 requires slf4j, then slf4j will load and turn on.

In my file pom.xmlthere is:

<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-c3p0</artifactId>
  <version>3.3.1.GA</version>
</dependency>
+3
source share
2 answers

Perhaps slf4j is an optional dependency. You can easily check transitive dependencies using the dependency plugin

mvn dependency:tree

will show you a list of trees that exactly depends on what exactly. If slf4j is not a fingerprint, you can add its explication.

NTN

+5

NoClassDefFoundError org.slf4j.impl.StaticLoggerBinder , SLF4J . hibernate-c3p0 slf4j-api. slf4j-api . . SLF4J: www.slf4j.org/manual.html

slf4j-simple, slf4j-log4j12, slf4j-jdk14 logback-classic . SLF4J, , .

+4

Source: https://habr.com/ru/post/1709355/


All Articles