---
title: "SLF4J错误"
author: "matychen"
date: "2011-06-29T09:19:03Z"
tags: []
categories: ["编程语言"]
slug: "slf4j"
draft: false
lastmod: "2011-06-29T09:19:03Z"
id: 1108827
url: "https://matychen.iteye.com/blog/1108827"
---

SLF4J: The requested version 1.6 by your slf4j binding is not compatible with 
SLF4J: See http://www.slf4j.org/codes.html#version_mismatch for further details.
Exception in thread "main" java.lang.NoSuchMethodError: org.slf4j.spi.LocationAwareLogger.log(Lorg/slf4j/Marker;Ljava/lang/String;ILjava/lang/String;[Ljava/lang/Object;Ljava/lang/Throwable;)V
	at org.apache.commons.logging.impl.SLF4JLocationAwareLog.info(SLF4JLocationAwareLog.java:159)
	at org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:456)
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:394)
	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:140)
	at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:94)
	at main.Run.main(Run.java:33)

前些天在写一个基于JMS的程序时报这个错误，开始编译阶段还好好的，后来打包发布的时候就出现这个问题，后来发现是activemq-all-5.5.0.jar里面包含了一个SLF4J的旧版本的class。后来删除里面的slf4j就没有出现这个情况了，如果你也遇到了类似的错误，不妨找找是不是你的其他的jar包里面包含了slf4j低版本的class或者jar。