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

Exception when Upgraded to 1.4.13 #744

Closed
hantsy opened this issue Nov 30, 2023 · 6 comments
Closed

Exception when Upgraded to 1.4.13 #744

hantsy opened this issue Nov 30, 2023 · 6 comments

Comments

@hantsy
Copy link

hantsy commented Nov 30, 2023

hantsy/spring6-sandbox#501

In My Spring 6 example, when upgrading to 1.4.13, it failed the tests run on Github actions.

0.040 s <<< ERROR!
java.lang.NoSuchMethodError: 'java.lang.ClassLoader ch.qos.logback.core.util.Loader.systemClassloaderIfNull(java.lang.ClassLoader)'
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:73)
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:66)
	at ch.qos.logback.classic.spi.LogbackServiceProvider.initializeLoggerContext(LogbackServiceProvider.java:52)
	at ch.qos.logback.classic.spi.LogbackServiceProvider.initialize(LogbackServiceProvider.java:41)
@LeadingMoominExpert
Copy link

I'm seeing the same kind of exceptions when upgrading from 1.4.11 to 1.4.12

@beytularedzheb
Copy link

I had the same issue after the upgrade from 1.4.11 to 1.4.12 / 1.4.13. The way I fixed it was by explicitly adding logback-core dependency with the same version as logback-classic.

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.4.13</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.4.13</version>
    </dependency>

@dc-oe
Copy link

dc-oe commented Dec 5, 2023

We have also experienced this exception moving to 1.4.14 from 1.4.11. We have matched versions of the jars, so the workaround mentioned is not applicable to us.

@ceki
Copy link
Member

ceki commented Dec 5, 2023

The Loader.systemClassloaderIfNull method was added in commit bf59a63 part of logback version 1.4.12 released on 2023-11-27. The exception is thrown only if logback-core artifact is older than 1.4.12.

@dc-oe Please to check that the logback-core artifact is indeed version 1.4.12 or later. I am rather certain that the logback-core and logback-classic versions in your project do not match.

@dc-oe
Copy link

dc-oe commented Dec 5, 2023

You would be correct. We are running under Tomcat and had 2 copies under different classsloaders. Neglected to update the one in Tomcat's classloader. All is good.

@ceki ceki closed this as completed Dec 5, 2023
@sivagnanavelu
Copy link

I had the same issue after the upgrade from 1.4.11 to 1.4.12 / 1.4.13. The way I fixed it was by explicitly adding logback-core dependency with the same version as logback-classic.

    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-classic</artifactId>
        <version>1.4.13</version>
    </dependency>
    <dependency>
        <groupId>ch.qos.logback</groupId>
        <artifactId>logback-core</artifactId>
        <version>1.4.13</version>
    </dependency>

This is worked for me also. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants