我试图在项目的一个简单示例中使用 quartz 。我收到以下异常,我不确定这意味着什么...但是,即使我仍然将我的slf4j更新为1.6.1,但仍会出现在POM文件中,
SLF4J: slf4j-api 1.6.x (or later) is incompatible with this binding.
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.impl.StaticLoggerBinder.getSingleton()Lorg/slf4j/impl/StaticLoggerBinder;
at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121)
at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:111)
at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:268)
at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:241)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:155)
at org.apache.commons.logging.impl.SLF4JLogFactory.getInstance(SLF4JLogFactory.java:131)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:395)
at org.quartz.impl.StdSchedulerFactory.<init>(StdSchedulerFactory.java:249)
............
在这方面的任何帮助将不胜感激。谢谢。
最佳答案
您需要所有SLF4J依赖项才能使用相同版本。
SLF4J: Your binding is version 1.5.5 or earlier.
SLF4J: Upgrade your binding to version 1.6.x. or 2.0.x
如果您查看依赖关系树,我希望您会发现它所使用的各种jar的版本超过SLF4J。
例如
[INFO] +- org.hibernate:hibernate-core:jar:3.5.3-Final:compile
[INFO] | +- antlr:antlr:jar:2.7.7:compile (version managed from 2.7.6)
[INFO] | \- org.slf4j:slf4j-api:jar:1.5.8:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.8:compile
在此,两个slf4j dep具有相同的版本。
关于exception - quartz quartz slf4j异常,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/5347912/