2

I'm building a Java API and this happens on my vsCode when I try to debug my main class :

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/CDINDELE/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]

I know this is a exclusion issue, so I've excluded the slf4j from my dependencies like this:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
     <exclusion>
         <groupId>org.slf4j</groupId>
         <artifactId>slf4j-over-log4j12</artifactId>
      </exclusion>
 </exclusions>
</dependency>

It works well with mvn install, and my API is working great with

java -jar myWar

However when I'm trying to use the debug with vscode on my main class (using the java plugin) the issue is coming back so it's impossible for me to debug this app which is not very convenient.

Any ideas ? Thanks

GKP
  • 1,057
  • 1
  • 11
  • 24
Cesar
  • 453
  • 9
  • 21
  • please check this link: https://stackoverflow.com/questions/19656496/multiple-slf4j-bindings-cause-error?rq=1 – Killer Feb 01 '19 at 13:35
  • @Killer As I said, It works great when I'm building the war, so it should be good, it's not working when I'm debugging the app – Cesar Feb 01 '19 at 13:39
  • Could you try to clear `.m2` folder or simply just libs in `vscode`? But for safety put `.m2` folder into a zip archive. Also as an alternative way you can try to do the same with another IDE as an `Intellij IDEA` and check the difference and result of it. – invzbl3 Nov 18 '22 at 22:35
  • Or try to print the maven dependency tree this should show you all the bindings and help you resolve the issue. – invzbl3 Nov 19 '22 at 15:43

0 Answers0