- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我使用 gradle 和 latest.release
到处都是混杂的,但是,最近我的 Spring 启动应用程序停止从命令行运行。当我跑 gradle clean bootRun
我得到...
Exception in thread "main" java.lang.IllegalArgumentException: LoggerFactory is not a Logback LoggerContext but Logback is on the classpath. Either remove Logback or the competing implementation (class org.slf4j.impl.Log4jLoggerFactory loaded from file:/.../.gradle/caches/modules-2/files-2.1/org.slf4j/slf4j-log4j12/1.7.25/110cefe2df103412849d72ef7a67e4e91e4266b4/slf4j-log4j12-1.7.25.jar). If you are using WebLogic you will need to add 'org.slf4j' to prefer-application-packages in WEB-INF/weblogic.xml: org.slf4j.impl.Log4jLoggerFactory
configurations.all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-tomcat'
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'org.springframework.boot', module: 'logback-classic'
exclude group: "org.slf4j"
}
Caused by: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk-10.0.1.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
最佳答案
我有这个并通过排除 spring-boot-starter-logging
来修复它和 logback-classic
并在 gradle.build
中添加 spring log4j2 实现
configurations {
all {
exclude group: 'org.springframework.boot', module: 'spring-boot-starter-logging'
exclude group: 'ch.qos.logback', module: 'logback-classic'
}
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter-log4j2:2.2.6.RELEASE'
关于spring-boot - 突然得到 "LoggerFactory is not a Logback LoggerContext but Logback is on the classpath."并且无法运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50824361/
我是一名优秀的程序员,十分优秀!