slf4j 石英异常
我正在尝试在项目的一个简单示例中使用石英。我收到以下异常,我不确定这意味着什么...但是我在 POM 文件中将 slf4j 更新为 1.6.1,即使这样仍然出现,
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)
............
对此的任何帮助将不胜感激。谢谢。
I am trying to use quartz in a simple example in project. I am getting the following exception, I am not sure what it means...However I updated my slf4j to 1.6.1 in my POM file even then this still appears,
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)
............
Any help on this would be highly appreciated. Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要所有 SLF4J 依赖项才能使用相同的版本。
如果你查看你的依赖树,我希望你会发现不止一个版本的 SLF4J 用于它使用的各种 jar。
例如
,这里两个 slf4j dep 具有相同的版本。
You need all your SLF4J dependencies to use the same version.
If you look at your dependency tree, I expect that you'll find more then one version of SLF4J for the various jar it uses.
For example
Here the two slf4j deps have the same version.
看起来石英内部使用的 SLF4J 绑定太旧了。您应该从quartz 中排除旧版本,并明确地将新版本添加到您的项目中。运行
mvn dependency:tree
并在此处发布您的结果。那时我就能给你准确的指示。Looks like the SLF4J binding used inside quartz is too old. You should exclude the old version from quartz and add a new one explicitly to your project. Run
mvn dependency:tree
and post your result here. I will be able to give you exact instructions then.