embedded-redis
embedded-redis copied to clipboard
Minor: move slf4j dependency to test dependencies (unused in library).
Hi, My very little contrib to your great work. Regards, /DV
ping ;-)
It's not a minor issue, it causes all tests to fail with Spring Boot 2.5.2.
Caused by: java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:132)
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:124)
at org.springframework.test.context.junit.jupiter.SpringExtension.getApplicationContext(SpringExtension.java:283)
at org.springframework.test.context.junit.jupiter.SpringExtension.resolveParameter(SpringExtension.java:269)
at org.junit.jupiter.engine.execution.ExecutableInvoker.resolveParameter(ExecutableInvoker.java:216)
... 77 more
Caused by: 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.impl.SimpleLoggerFactory loaded from file:/Users/me/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.31/cf5df9007f6fb85f04728eec1dd96de73533fec7/slf4j-simple-1.7.31.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:702)
Any maintainer with a heartbeat still around?
🙏 anyone there?
Can confirm that causes the same issue as described by @asarkar in Spring Boot 2.3.2.
I found out a workarround in this korean website
Gradle
compile ('it.ozimov:embedded-redis:0.7.3') { exclude group: "org.slf4j", module: "slf4j-simple" }
Kotlin Gradle
testImplementation("it.ozimov:embedded-redis:0.7.3") { exclude(group = "org.slf4j", module = "slf4j-simple") }
Up @robertotru and Happy New Year!
Ah, glad to find out where this issue came from! For me it was not tied to upgrading Spring Boot though, but only happened after upgrading Gradle from 7.2 to 7.3.x The workaround with excluding the dependency worked for me.
It's not a minor issue, it causes all tests to fail with Spring Boot 2.5.2.
Caused by: 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.impl.SimpleLoggerFactory loaded from file:/Users/me/.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-simple/1.7.31/cf5df9007f6fb85f04728eec1dd96de73533fec7/slf4j-simple-1.7.31.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.SimpleLoggerFactory at org.springframework.util.Assert.instanceCheckFailed(Assert.java:702)