SLF4J: Class path contains multiple SLF4J bindings. maven 해결 방법
by 무작정 개발Spring으로 개발을 하다 SLF4J: Class path contains multiple SLF4J bindings. 에러를 만나 해결 방법을 정리하였다.

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Users/hwchae/.m2/repository/org/slf4j/slf4j-log4j12/1.6.4/slf4j-log4j12-1.6.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/C:/Users/hwchae/.m2/repository/ecm/ecm/2.1.4/ecm-2.1.4.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
구글링을 해보니 multibinding이 되서 둘 중 1개를 exclude(제외)를 하거나 dependency를 제거하면 해결할 수 있다는 정보를 찾았다.
쉽게 말하자면 2개 이상의 jar 파일이 중복 사용된 것이라 말할 수 있다.
이 문제는 maven에서 해당 설정을 잡아주면 된다. maven은 pom.xml에서 설정하면 되고, gradle을 사용 중이면 gradle에서 dependency를 수정하면 된다.
slf4j API는 한 번에 1개의 기본 로깅 프레임워크와 바인딩하도록 설계돼있고, 클래스 경로에 둘 이상의 바인딩이 있는 경우
SLF4J는 해당 바인딩의 위치를 나열하는 경고를 보낸다고 작성되어 있습니다.

<dependencies>
<groupId> org.apache.cassandra</groupId>
<artifactId>cassandra-all</artifactId>
<version>0.8.1</version>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
</exclusion>
<exclusion>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
</exclusion>
</exclusions>
</dependencies>
위와 같이 pom.xml을 수정 후에 [ maven clean - install ] 를 진행하면 해결된다.
SLF4J: Class path contains multiple SLF4J bindings 참고 자료
SLF4J Error Codes
SLF4J warning or error messages and their meanings No SLF4J providers were found. This warning, i.e. not an error, message is reported when no SLF4J providers could be found on the class path. Placing one (and only one) of slf4j-nop.jar slf4j-simple.jar, s
www.slf4j.org
'Trouble Shooting' 카테고리의 다른 글
| [Spring] Windows - Port already in use: 8080 해결 방법 (0) | 2023.01.30 |
|---|---|
| [Spring] IOException: 현재 연결은 사용자의 호스트 시스템의 소프트웨어의 의해 중단되었습니다 (0) | 2023.01.30 |
| [Spring boot] Inferred type 'S' for type parameter 'S' is not within its bound; should extend (2) | 2022.09.24 |
| [Mac OS] Port 8080 was already in use 해결 방법 (2) | 2022.08.26 |
| [JPA + MariaDB] Data too long for column 에러 해결 (1) | 2022.08.24 |
블로그의 정보
무작정 개발
무작정 개발