Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NoSuchMethodError with SLF4J API

Tags:

java

slf4j

When Use with slf4j,

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

Trace as below

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) 
like image 926
user496949 Avatar asked Mar 29 '11 22:03

user496949


1 Answers

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).

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

like image 120
skaffman Avatar answered Oct 04 '22 09:10

skaffman