Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot 3.3.2: java.lang.ClassNotFoundException: ch.qos.logback.core.util.StatusPrinter2

I have upgraded the Spring Boot version from 3.2.2 to 3.3.2.

While running the application, I am facing this error given below :

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:520)
    ... 20 more

I have these logback dependencies added in the pom.xml given below:

<dependencies>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-access</artifactId>
        <version>1.4.14</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.4.14</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.4.14</version>
    </dependency>
</dependencies>

I have checked in the project and there are no dependency conflicts.

How to resolve this issue?

like image 571
desi_stoic Avatar asked Feb 06 '26 22:02

desi_stoic


1 Answers

Spring Boot 3.3.2 uses logback version 1.5.6.

So, you need to upgrade your logback library from 1.4.14 to 1.5.6.

FYI: The logback-core version 1.5.6 has the ch.qos.logback.core.util.StatusPrinter2 class in it.

Just update the existing logback dependencies given below in the pom.xml:

<dependencies>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-access</artifactId>
        <version>1.5.6</version> <!-- version is optional -->
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.5.6</version> <!-- version is optional-->
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.5.6</version> <!-- version is optional -->
    </dependency>
</dependencies>

Also, you don't need to add these dependencies explicitly for logback, as Spring Boot comes with logback libraries by default. So, you can safely remove these dependencies.

Read the Java docs on ch.qos.logback.core.util.StatusPrinter2 for more information.

See if this helps.

like image 85
Anish B. Avatar answered Feb 09 '26 09:02

Anish B.



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!