반응형
프로젝트 구조
- Java 21
- gradle
- Spring boot 3.X
- Spring Webflux
- kotlin
에러 발생
- java, spring boot, gradle 등 프로젝트 주요 라이브러리의 버전업 후, 프로젝트 boot시에 에러가 발생하는 것을 발견
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.helpers.NOPLoggerFactory loaded from file:/Users/kidd.curious/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-api/2.0.11/ad96c3f8cf895e696dd35c2bc8e8ebe710be9e6d/slf4j-api-2.0.11.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.helpers.NOPLoggerFactory
원인
- spring-boot-starter-webflux가 최신버전으로 변경되면서 logback를 이미 포함하고 있어서 발생한 오류이다.
- 이미 필요한 라이브러리가 있는데, 중복으로 선언하고 또한 버전이 맞지 않는 라이브러리들을 사용하기에 발생한 오류
해결방법
- 중복으로 선언되어있는 Logback 라이브러리를 지워주면서 해결하였다.
반응형