Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor: move slf4j dependency to test dependencies (unused in library). #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

doumdoum
Copy link

Hi,
My very little contrib to your great work.
Regards,
/DV

@doumdoum
Copy link
Author

ping ;-)

@asarkar
Copy link

asarkar commented Jul 23, 2021

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?

@chrispwright
Copy link

🙏 anyone there?

@EndermanAPM
Copy link

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") }

@doumdoum
Copy link
Author

doumdoum commented Jan 3, 2022

Up @robertotru and Happy New Year!

@alexkops
Copy link

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)

InSooBae added a commit to InSooBae/springboot-web-socket-tutorial that referenced this pull request Aug 21, 2022
ozimov/embedded-redis#18
임베디드 레디스의 고질적인 이슈였었다. 해당 과정으로 수정
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants