[slf4j-user] NoClassDef on LoggerFactory

jimweaver weaver.je at gmail.com
Fri Feb 1 00:50:26 CET 2013


Hi,

I have added a third party tool (yammer's Metrics) which uses slf4j to my
java web application.  At points where the Metrics classes attempt to log, I
am getting a NoClassDefFound on org.slf4j.LoggerFactory:

Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at com.yammer.metrics.reporting.JmxReporter.(JmxReporter.java:19)
	at com.yammer.metrics.Metrics.(Metrics.java:20)

In this case I am running my application from Jetty, and the jetty launch
class path includes the following slf jars (forgive long paths, pasting this
snippet directly from classpath echoed out on console):

....metrics-core-2.2.0.jar:/Users/jimweaver/.m2/repository/org/slf4j/slf4j-api/1.7.2/*slf4j-api-1.7.2.jar*:/Users/jimweaver/.m2/repository/org/slf4j/slf4j-jdk14/1.7.1/*slf4j-jdk14-1.7.1.jar*:/Users/jimweaver/.m2/repository/org/slf4j/slf4j-nop/1.7.2/*slf4j-nop-1.7.2.jar*:/Users/jimweaver/.m2/repository/org/apache/lucene/lucene-core/2.9.1/lucene-core-2.9.1.jar:/Users/jimweaver/.m2/repos......

These are the only occurrences of slf4j jars on the classpath - there are no
other conflicting older versions present.  The LoggerFactory class is pretty
clearly inside the slf4j-api-1.7.2.jar file, and it does not appear to have
any static block code in that class that might fail and erroneously report
it as a class not found exception.  So, I am a bit stumped.  Class is
present on the web application's classpath, but being reported as not found. 
The path is being generated by my jetty launcher, and classes in jars
following the slf4j jars are being found, so there aren't any funky typos in
the path that would cause the inclusion of jars in the path sting to be
short-circuited.

Anyone have any ideas?



--
View this message in context: http://slf4j.42922.n3.nabble.com/NoClassDef-on-LoggerFactory-tp4025414.html
Sent from the slf4j - user mailing list archive at Nabble.com.


More information about the slf4j-user mailing list