關於Logback的一個異常
java.lang.NoSuchMethodError: org.slf4j.helpers.MessageFormatter.arrayFormat(Ljava/lang/String;[Ljava/lang/Object;)Lorg/slf4j/helpers/FormattingTuple;
原因可能有兩個:
1、jar包衝突,build path下可能加入了 slf4j-log4或者 log4j的jar包,刪除即可。
2、jar包版本導致的,例如 如果你的Logback是1.0.6版本,那麼你的slf4j需要[1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11]版本的。
SLF4J: The requested version 1.6 by your slf4j binding is not compatible with [1.5.5, 1.5.6, 1.5.7, 1.5.8, 1.5.9, 1.5.10, 1.5.11]
不管是Logback版本高還是slf4j的低只要找對匹配的版本即可。