---
title: "SLF4J错误的最大可能性"
author: "青春的、脚步"
date: "2012-06-26T10:05:00Z"
tags: []
slug: "slf4j"
draft: false
lastmod: "2014-01-24T16:52:42Z"
id: 2009185
url: "https://youngstep.iteye.com/blog/2009185"
---

1、NoSuchMethodError:org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;&lt;wbr style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;Ljava&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;lang&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;String&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;;&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;ILjava&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;lang&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;String&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;;&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;Ljava&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;lang&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;/&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;Throwable&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;;)&lt;/span&gt;&lt;span style="color:rgb(221,75,57); font-style:normal; font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;V&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;&lt;/span&gt;&lt;span style="color:rgb(34,34,34); font-family:arial,sans-serif; line-height:16px; font-size:12px"&gt;...&lt;/span&gt;&lt;/wbr&gt;

2、java.lang.ClassNotFoundException: org.apache.log4j.Level

等…… 还有几个错误异常不记得了。。。。

原因就是slf4j-api-1.6.6.jar、slf4j-log4j12-1.6.6.jar、jcl-over-slf4j-1.6.6.jar 这3个JAR包的版本不同。

如果你也遇到这种蛋疼的错误，看下你的版本是否一致。

slf4j下载地址：[点击打开链接](http://download.csdn.net/detail/vbubble/4393227)