https://kotlinlang.org logo
#ktor
Title
# ktor
c

Cristian Rosa

11/11/2021, 4:14 PM
Does anyone know (or had faced the problem) when I “runDistributable” (or the app from the file generated buy intellij) I got this error:
Copy code
Failed to instantiate SLF4J LoggerFactory
Reported exception:
java.lang.NoClassDefFoundError: javax/naming/NamingException
The weird thing is if I run the app throw the IDE or with a jar by command line no error and everything works as expected the module where I got the error is a pretty simple ktor server (with some client part to talk to a master-server) a very simple views written in compose
according a few researches it seems a problem from logback used by ktor for logging messages!
Copy code
implementation("ch.qos.logback:logback-classic:$logback_version")
by taking that line out for build.gradle app start works with a different error:
Copy code
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See <http://www.slf4j.org/codes.html#StaticLoggerBinder> for further details.