Unable to start spring boot server

前端 未结 9 1885
既然无缘
既然无缘 2020-12-29 03:51

I am new to spring boot and when I try to start my server , I get the following Exception. I understand that this has something to do with dependency conflict, but still una

相关标签:
9条回答
  • 2020-12-29 04:14

    Finally resolved this issue by excluding the Logback dependency and explicitly adding the log4j dependency

    0 讨论(0)
  • 2020-12-29 04:18

    Excluding logback-classic from spring-boot-starter-web and spring-boot-starter-actuator worked for me

    compile("org.springframework.boot:spring-boot-starter-web:1.1.10.RELEASE") {
        exclude module: "spring-boot-starter-tomcat"
        exclude module: "spring-boot-starter-logging"
        exclude module: "logback-classic"
    }
    compile("org.springframework.boot:spring-boot-starter-actuator:1.1.10.RELEASE") {
        exclude module: "logback-classic"
    }
    
    0 讨论(0)
  • 2020-12-29 04:20

    the following configuration in my gradle.build file worked for me:

    configurations {
        all*.exclude group: "org.springframework.boot", module: "spring-boot-starter-logging"
        all*.exclude group: "ch.qos.logback"
        all*.exclude group: "org.slf4j", module: "log4j-over-slf4j" // allow using log4j 2.x
        all*.exclude group: "org.slf4j", module: "slf4j-simple"     // log4j is the configured backend
    }
    
    0 讨论(0)
  • 2020-12-29 04:22

    Gradle solution is adding below lines in build.gradle :

    configurations {
        all*.exclude module : 'spring-boot-starter-logging'
    }
    
    0 讨论(0)
  • 2020-12-29 04:27

    Repeat answer but you can use Eclipse to exclude the spring-boot-starter-logging dependency

    1. Select dependency hierarchy
    2. Search for logging top right
    3. Select spring-boot-starter-logging
    4. Right click exclude maven artifact

    e.g enter image description here

    0 讨论(0)
  • 2020-12-29 04:27

    Spring Boot supports Log4j 2 for logging configuration if it is on the classpath. If you use the starters for assembling dependencies, you have to exclude Logback and then include log4j 2 instead.

    0 讨论(0)
提交回复
热议问题