I am getting following runtime Exception while running my java code. Could someone please help me resolve the binding conflicts.
SLF4J: Class path contai
This Works !! Update the porm.xml
<dependency>
<groupId>org.someexternallib</groupId>
<artifactId>someexternallibartifact</artifactId>
<version>...</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
Run mvn dependency:tree
and search which dependency have the slf4j
implementations you do not want, then exclude them with a dependency exclusion like:
<dependency>
<groupId>org.someexternallib</groupId>
<artifactId>someexternallibartifact</artifactId>
<version>...</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependency>
You can go to POM.xml , open Dependency Hierarchy and find slf4j entries.Except one exclude rest of them by right clicking "exclude maven artifact"
This error means that you have multiple implementations of SLF4J in your classpath.
Look for what the errors are specifically saying. i.e :
SLf4J: Found binding in.....
(This will print all the jar files where it found instances of StaticLoggerBinder.class). Eliminate all such jars from your classpath, except the jar whose StaticLoggerBinder.class implementation you need.
It seems you have several implementation of SLF4J; you should exclude all the not necessary ones