You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello!
I'm trying using this library for bot with Spring boot 3 and I'm getting exseption with text: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.
If exclude "ch.qos.logback:logback-classic" artifact from spring starters, logging won't work.
Expected behavior
Way to using this library with spring boot 3 is exists Actual behavior
Exception on startup application or NOPlogger is used in case exclude dep logback-classic To Reproduce
plugins {
id("org.springframework.boot") version "3.2.2"
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter") {
// to avoid LoggerFactory is not a Logback LoggerContext but Logback is on the classpath
// exclude(group = "ch.qos.logback", module = "logback-classic")
}
Exception in thread "restartedMain" java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:119)
at java.base/java.lang.reflect.Method.invoke(Method.java:577)
at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:50)
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.helpers.NOPLoggerFactory loaded from file:/home/oleg/.gradle/caches/modules-2/files-2.1/com.github.kotlin-telegram-bot.kotlin-telegram-bot/webhook/6.1.0/d8c5b2c669f9bf0a663433816bc0490bf3ba9e58/webhook-6.1.0.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
at org.springframework.util.Assert.instanceCheckFailed(Assert.java:592)
at org.springframework.util.Assert.isInstanceOf(Assert.java:511)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:396)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:124)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:238)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:171)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:149)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:137)
at org.springframework.boot.context.event.EventPublishingRunListener.multicastInitialEvent(EventPublishingRunListener.java:136)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:75)
at org.springframework.boot.SpringApplicationRunListeners.lambda$starting$0(SpringApplicationRunListeners.java:54)
at java.base/java.lang.Iterable.forEach(Iterable.java:75)
at org.springframework.boot.SpringApplicationRunListeners.doWithListeners(SpringApplicationRunListeners.java:118)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:54)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:326)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1354)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1343)
at org.babun.habbits_bot.HabitsBotApplicationKt.main(HabitsBotApplication.kt:19)
at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
... 2 more
Possible solutions
module webhook is published as fatJar so we can't exclude slf4j dep
The text was updated successfully, but these errors were encountered:
Hello!
I'm trying using this library for bot with Spring boot 3 and I'm getting exseption with text:
LoggerFactory is not a Logback LoggerContext but Logback is on the classpath.
If exclude "ch.qos.logback:logback-classic" artifact from spring starters, logging won't work.
Expected behavior
Way to using this library with spring boot 3 is exists
Actual behavior
Exception on startup application or NOPlogger is used in case exclude dep logback-classic
To Reproduce
This is my build.gradle.kts
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("org.springframework.boot") version "3.2.2"
id("io.spring.dependency-management") version "1.1.4"
kotlin("jvm") version "1.9.22"
kotlin("plugin.spring") version "1.9.22"
}
group = "com.github"
version = "0.0.1-SNAPSHOT"
java {
sourceCompatibility = JavaVersion.VERSION_17
}
repositories {
mavenCentral()
maven("https://jitpack.io")
}
dependencies {
implementation("org.springframework.boot:spring-boot-starter") {
// to avoid LoggerFactory is not a Logback LoggerContext but Logback is on the classpath
// exclude(group = "ch.qos.logback", module = "logback-classic")
}
}
tasks.withType {
kotlinOptions {
freeCompilerArgs += "-Xjsr305=strict"
jvmTarget = "17"
}
}
tasks.withType {
useJUnitPlatform()
}
Screenshots/Traceback
Possible solutions
module webhook is published as fatJar so we can't exclude slf4j dep
The text was updated successfully, but these errors were encountered: