Exception in thread "main" java.lang.NoClassDefFoundError: ch/qos/logback/core/util/StatusPrinter2
at org.springframework.boot.logging.logback.LogbackLoggingSystem.<init>(LogbackLoggingSystem.java:110)
at org.springframework.boot.logging.logback.LogbackLoggingSystem$Factory.getLoggingSystem(LogbackLoggingSystem.java:495)
at org.springframework.boot.logging.DelegatingLoggingSystemFactory.getLoggingSystem(DelegatingLoggingSystemFactory.java:44)
at org.springframework.boot.logging.LoggingSystem.get(LoggingSystem.java:167)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:237)
at org.springframework.boot.context.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:220)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:185)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:178)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:156)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:138)
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:327)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1363)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1352)
at com.interswitchng.collections.Application.main(Application.java:10)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.core.util.StatusPrinter2
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 20 more
Comment From: wilkinsona
Generally speaking, a stack trace alone isn't enough to be able to diagnose a problem. We're a small team with limited time so you need to do as much as possible to help to diagnose the problem. Even knowing the versions of Spring Boot and Logback that you're using would have been helpful here.
StatusPrinter2, the class that is missing, is new in Logback 1.5.4. I would guess, and that's all that we can do given the lack of information, that you've downgraded Logback and are trying to use an earlier version of Logback. Please ensure that you're using at least Logback 1.5.4.
If the above doesn't help and you would like us to spend some more time investigating, please spend some time providing a complete yet minimal sample that reproduces the problem. You can share it with us by pushing it to a separate repository on GitHub or by zipping it up and attaching it to this issue. We can then re-open this issue and take another look.
Comment From: airnest97
I am using springboot 3.3.2 and the project added in logback classic 1.3.7 with using and logstash-logback-encoder 7.4 as stated on the github repo. However, this overrode the logback classic in springboot-starter-logging with version 1.5.6 Thank you for pointing me in the right direction as the recommendation you gave worked.
Comment From: sondemar
Hi @airnest97, regarding the dependency incompatibility issue, you can use the latest version of logstash-logback-encoder, which contains logback versions compliant with spring-boot-starter-logging