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

SLF4J: multiple SLF4J bindings with Gradle Plugin #13788

Closed
jdkhome opened this issue Jul 15, 2020 · 1 comment
Closed

SLF4J: multiple SLF4J bindings with Gradle Plugin #13788

jdkhome opened this issue Jul 15, 2020 · 1 comment
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be

Comments

@jdkhome
Copy link

jdkhome commented Jul 15, 2020

Expected Behavior

The procedure is executed normally

Current Behavior

➜  example git:(master) ✗ gradle bootRun

> Task :bootRun FAILED
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/Users/linkji/.gradle/caches/6.5.1/generated-gradle-jars/gradle-api-6.5.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/Users/linkji/.gradle/caches/modules-2/files-2.1/ch.qos.logback/logback-classic/1.2.3/7c4f3c474fb2c041d8028740440937705ebb473a/logback-classic-1.2.3.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 [org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext]
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.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext loaded from file:/Users/linkji/.gradle/caches/6.5.1/generated-gradle-jars/gradle-api-6.5.1.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.gradle.internal.logging.slf4j.OutputEventListenerBackedLoggerContext
        at org.springframework.util.Assert.instanceCheckFailed(Assert.java:696)
        at org.springframework.util.Assert.isInstanceOf(Assert.java:596)
        at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:284)
        at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:104)
        at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:232)
        at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:213)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:127)
        at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:74)
        at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:47)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:305)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
        at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
        at com.jdkhome.example.Application.main(Application.java:12)

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':bootRun'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk-11.0.3.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.5.1/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 1s
4 actionable tasks: 1 executed, 3 up-to-date

Context

see https://stackoverflow.com/questions/51644795/slf4j-multiple-slf4j-bindings-with-gradle-plugin
But it doesn't really solve the problem

Steps to Reproduce

https://github.com/jdkhome/multiple-SLF4J-bindings-with-Gradle-Plugin

Your Environment

jdk 11
gardle 6.5.1

@ljacomet
Copy link
Member

Thank you for your interest in Gradle!

Please ask such a usage question on https://discuss.gradle.org or https://stackoverflow.com where to get answers by the community of Gradle users.

If, after investigation, it turns out to be a Gradle bug or missing feature, please file another issue describing the problem or use case and add a reproducer.


Your reproducer includes the plugin org.gradle.kotlin.kotlin-dsl. This plugin is to be used when developing Gradle logic which should not have an intersection with a Spring Boot software component.

Removing that should resolve the issue you face.

@jbartok jbartok closed this as completed Sep 13, 2021
@jbartok jbartok added closed:not-fixed Indicates the issue was not fixed and is not planned to be and removed a:bug to-triage labels Sep 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed:not-fixed Indicates the issue was not fixed and is not planned to be
Projects
None yet
Development

No branches or pull requests

5 participants