使用SLF4J API的NoSuchMethodError [英] NoSuchMethodError with SLF4J API

查看:216
本文介绍了使用SLF4J API的NoSuchMethodError的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当与slf4j一起使用时,

When Use with slf4j,

String test = blahblahblah;
logger.info("{}",test);

跟踪如下

java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.format(Ljava/lang/String;Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;

at org.slf4j.impl.JDK14LoggerAdapter.info(JDK14LoggerAdapter.java:304)


推荐答案

看起来各种SLF4J API和集成库之间的版本不匹配。在版本兼容性方面,SLF4J非常抽象(例如1.6.x不向后兼容1.5.x)。

Looks like you have a version mis-match between the various SLF4J API and integration libraries. SLF4J is extremely twitchy when it comes to version compatibility (e.g. 1.6.x is not backwards compatible with 1.5.x).

确保各种JAR版本匹配,并确保类路径上没有重复的JAR。

Make sure the various JAR versions match, and make sure there are no duplicate JARs on the classpath.

这篇关于使用SLF4J API的NoSuchMethodError的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆