Spring boot로 개발을 하다가 아래와 같은 에러사항을 발견했다.


SLF4J: Class path contains multiple SLF4J bindings.

SLF4J: Found binding in [jar:file:/Users/ihowon/.m2/repository/ch/qos/logback/logback-classic/1.1.11/logback-classic-1.1.11.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: Found binding in [jar:file:/Users/ihowon/.m2/repository/org/slf4j/slf4j-log4j12/1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.

SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]


뭐 대강 설명을 보자하니, 두 개 이상의 jar파일이 한 파일에서 import 되었으며, 해당 파일(StaticLoggerBinder.class)을 뒤져보니 slf4j-log4j12-17.25.jar와 logback-classic-1.1.11.jar 파일이 중복사용되었다는 듯.


구글을 뒤져보니 maven에서 해당 설정을 잡아주면 된다고 한다. maven은 pom.xml에서 설정을 할 수 있다.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<dependency>
    <groupId>org.apache.hbase</groupId>
    <artifactId>hbase</artifactId>
    <version>0.90.2</version>
    <exclusions>
        <exclusion>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
        </exclusion>
        <exclusion>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
        </exclusion>
    </exclusions>
</dependency>
cs


pom.xml의 hbase쪽에서 org.slf4j 와 log4j 부분을 추가해준 후, maven clean - install 을 해주면 된다.

그리고 해당 프로젝트를 실행하니 에러가 발생하지 않음을 확인했다.


블로그 이미지

김생선

세상의 모든것을 어장관리

,