[logback-user] Spring -> SLF4J -> Logback

Ceki Gulcu ceki at qos.ch
Mon Apr 11 10:44:27 CEST 2011


Luciano,

I suspect that you are pulling in an older version of jcl-over-slf4j. 
You can use the dependency plugin to see all dependencies. The command is:

mvn dependency:tree

HTH,
-- 
Ceki
QOS.ch, main sponsor of cal10n, logback and slf4j open source projects, 
is looking to hire talented software engineers. For further details, see 
http://logback.qos.ch/job.html


On 11.04.2011 10:03, David Roussel wrote:
>
> Luciano,
>
> The problem is probably because you have commons-logging the class path.
> Use the maven dependencies plugin to find where it is coming from.  It'll
> definately be coming from spring, but possibly other places.
>
> Then try this:
>
>
> 			<dependency>
> 				<groupId>org.springframework</groupId>
> 				<artifactId>spring-core</artifactId>
> 				<version>${spring-version}</version>
> 				<exclusions>
> 					<exclusion>
> 						<groupId>commons-logging</groupId>
> 						<artifactId>commons-logging</artifactId>
> 					</exclusion>					
> 				</exclusions>
> 			</dependency>
>
> David
>
>
> Luciano Santos-2 wrote:
>>
>> Hello.
>>
>>    I am trying to integrate Logback for the first time in a project of
>> mine, and i'm having such a hard time trying to use it along with
>> Spring 3.0.5.
>> I declared jcl-over-slf4j dependency so it replaces commons-logging
>> used by spring-core, but it seems like something is missing or wrong:
>>
>> 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.jca.context.SpringContextResourceAdapter.start(SpringContextResourceAdapter.java:151)
>> ...
>>
>> Here're my logging dependencies (No commons-logging or log4j are being
>> used):
>> 		<dependency>
>> 			<groupId>ch.qos.logback</groupId>
>> 			<artifactId>logback-core</artifactId>
>> 			<version>0.9.28</version>
>> 			<type>jar</type>
>> 			<scope>runtime</scope>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>ch.qos.logback</groupId>
>> 			<artifactId>logback-classic</artifactId>
>> 			<version>0.9.28</version>
>> 			<type>jar</type>
>> 			<scope>runtime</scope>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>org.slf4j</groupId>
>> 			<artifactId>slf4j-api</artifactId>
>> 			<version>1.6.1</version>
>> 			<type>jar</type>
>> 			<scope>runtime</scope>
>> 		</dependency>
>> 		<dependency>
>> 			<groupId>org.slf4j</groupId>
>> 			<artifactId>jcl-over-slf4j</artifactId>
>> 			<version>1.6.1</version>
>> 			<type>jar</type>
>> 			<scope>runtime</scope>
>> 		</dependency>
>>
>> Any thoughts about what may be wrong?
>>
>> Thank you
>>
>> Luciano





More information about the Logback-user mailing list