为什么我会收到此错误:
java.lang.NoSuchMethodError: ch.qos.logback.classic.LoggerContext.getBithTime()
我的猜测是拼写错误已修复,slf4j 和 logback 的版本不匹配,但我在发行说明中找不到任何说明哪些版本兼容的内容。
目前,我正在使用 org.slf4j.api 1.6.1 和 ch.qos.logback.classic 0.9.27。
它们来自 Eclipse Orbit,因此更改任何一个版本都不是很简单。
最佳答案
引用 Logback news :
January 25th, 2011 - Release of version 0.9.28
Breaking change: In the Context interface, the previously misspelled property bithTime is now renamed as birthTime.
In the Context interface, the previously misspelled property bithTime is now renamed as birthTime. This is a backward-incompatible change. All pre-existing references to "bithTime" property now need to referenced as "birthTime".
实际上 0.9.27 将 SLF4J 1.6.1 声明为依赖项,你确定你所有的 JAR 都有指定的版本吗?此方法在 Logback 模块之间内部使用,我猜它在所有模块中都已重命名,这表明您有不同版本的
logback-core
和 logback-classic
jar 。也真的考虑升级了,这个版本已经有一年多了,Logback 现在是 1.x 了。
关于slf4j - java.lang.NoSuchMethodError : ch. qos.logback.classic.LoggerContext.getBithTime(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9717518/