question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not compatible with Spring Boot 1.3.3 (upgrading logback to 1.1.5)

See original GitHub issue

Hi guys,

The Spring Boot project has released version 1.3.3 and they have upgraded logback from 1.1.3 to 1.1.5 (see the relevant commit). This seems not to be compatible with the current version of logstash-logback-encoder.

Starting my spring boot 1.3.3 sample app, I have the following stacktrace and the app refuse to boot.

Failed to instantiate [ch.qos.logback.classic.LoggerContext]
Reported exception:
java.lang.AbstractMethodError: ch.qos.logback.classic.pattern.EnsureExceptionHandling.process(Lch/qos/logback/core/pattern/Converter;)V
    at ch.qos.logback.core.pattern.PatternLayoutBase.start(PatternLayoutBase.java:88)
    at ch.qos.logback.classic.encoder.PatternLayoutEncoder.start(PatternLayoutEncoder.java:28)
    at ch.qos.logback.classic.BasicConfigurator.configure(BasicConfigurator.java:50)
    at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:164)
    at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:85)
    at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
    at org.slf4j.LoggerFactory.bind(LoggerFactory.java:143)
    at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:122)
    at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:378)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:328)
    at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:349)
    at io.jhipster.dockermicroservices.T1App.<clinit>(T1App.java:32)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run(AbstractRunMojo.java:478)
    at java.lang.Thread.run(Thread.java:745)
  • Removing the dependency to logstash-logback-encoder fixes it.
  • Downgrading to Spring boot 1.3.2 fixes it.

Thank you in advance. Best regards, Pierre Besson

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
markbiglercommented, Jun 5, 2016

Adding these lines to your pom.xml should fix the problem temporary:

    <dependency>
        <groupId>net.logstash.logback</groupId>
        <artifactId>logstash-logback-encoder</artifactId>
        <version>4.7</version>
        <exclusions>
            <exclusion>
                <groupId>ch.qos.logback</groupId>
                <artifactId>logback-core</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
0reactions
WesternGuncommented, Oct 6, 2019

I use gradle dependencyInsight --dependency logback to check the dependency tree, and I saw that, Spring Boot starter-logging 2.1.9 seems to be using logback-classic-1.1.3.

> Task :dependencyInsight
ch.qos.logback:logback-classic:1.1.3 (selected by rule)
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes)
      org.gradle.category            = library (not requested)

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 8
   ]

ch.qos.logback:logback-classic:1.1.3
\--- compileClasspath

ch.qos.logback:logback-classic:1.2.3 -> 1.1.3
\--- org.springframework.boot:spring-boot-starter-logging:2.1.9.RELEASE
     \--- org.springframework.boot:spring-boot-starter:2.1.9.RELEASE
          +--- compileClasspath (requested org.springframework.boot:spring-boot-starter)
          +--- org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE
          |    +--- compileClasspath (requested org.springframework.boot:spring-boot-starter-web)
          |    \--- org.springframework.boot:spring-boot-starter-websocket:2.1.9.RELEASE
          |         \--- compileClasspath
          +--- org.springframework.boot:spring-boot-starter-json:2.1.9.RELEASE
          |    +--- org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE (*)
          |    \--- org.springframework.boot:spring-boot-starter-jersey:2.1.9.RELEASE
          |         \--- compileClasspath (requested org.springframework.boot:spring-boot-starter-jersey)
          \--- org.springframework.boot:spring-boot-starter-validation:2.1.9.RELEASE
               \--- org.springframework.boot:spring-boot-starter-jersey:2.1.9.RELEASE (*)

ch.qos.logback:logback-core:1.1.3 (selected by rule)
   variant "compile" [
      org.gradle.status              = release (not requested)
      org.gradle.usage               = java-api
      org.gradle.libraryelements     = jar (compatible with: classes)
      org.gradle.category            = library (not requested)

      Requested attributes not found in the selected variant:
         org.gradle.dependency.bundling = external
         org.gradle.jvm.version         = 8
   ]

ch.qos.logback:logback-core:1.1.3
+--- compileClasspath
\--- ch.qos.logback:logback-classic:1.1.3
     +--- compileClasspath
     \--- org.springframework.boot:spring-boot-starter-logging:2.1.9.RELEASE (requested ch.qos.logback:logback-classic:1.2.3)
          \--- org.springframework.boot:spring-boot-starter:2.1.9.RELEASE
               +--- compileClasspath (requested org.springframework.boot:spring-boot-starter)
               +--- org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE
               |    +--- compileClasspath (requested org.springframework.boot:spring-boot-starter-web)
               |    \--- org.springframework.boot:spring-boot-starter-websocket:2.1.9.RELEASE
               |         \--- compileClasspath
               +--- org.springframework.boot:spring-boot-starter-json:2.1.9.RELEASE
               |    +--- org.springframework.boot:spring-boot-starter-web:2.1.9.RELEASE (*)
               |    \--- org.springframework.boot:spring-boot-starter-jersey:2.1.9.RELEASE
               |         \--- compileClasspath (requested org.springframework.boot:spring-boot-starter-jersey)
               \--- org.springframework.boot:spring-boot-starter-validation:2.1.9.RELEASE
                    \--- org.springframework.boot:spring-boot-starter-jersey:2.1.9.RELEASE (*)

And I change my logback-core to 1.1.3 and the problem is gone.

compile group: 'ch.qos.logback', name: 'logback-core', version: '1.1.3'
Read more comments on GitHub >

github_iconTop Results From Across the Web

Not compatible with Spring Boot 1.3.3 (upgrading logback to ...
Hi guys, The Spring Boot project has released version 1.3.3 and they have upgraded logback from 1.1.3 to 1.1.5 (see the relevant commit)....
Read more >
spring-boot upgrade from 1.3.2 to 1.3.3: logback issue
Spring Boot is missing some dependency management for logback-core which is allowing different versions to creep in. I've opened an issue to ...
Read more >
Logback upgrade from 1.1.11 to 1.3.0-alpha4 in Spring boot ...
At the time of writing, Spring Boot is not compatible with the new API. There's an issue that is tracking support of the...
Read more >
Spring Boot Reference Guide
Spring Boot is compatible with Apache Maven 3.2 or above. If you don't already have Maven installed you can follow the instructions at...
Read more >
News - Logback - QOS.ch
Logback components written for logback 1.2 should work without change in version 1.3. However, Joran, logback's configuration system, has been rewritten to ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found