[slf4j-user] NoClassDef on LoggerFactory

Maarten Bosteels mbosteels.dns at gmail.com
Fri Feb 1 09:11:39 CET 2013


Hi,

You have two SLF4J bindings in your classpath: slf4j-nop-1.7.2 and
slf4j-jdk14-1.7.1
Try removing one of them and see if it helps.

Also have a look at http://www.slf4j.org/manual.html

regards
Maarten

On Fri, Feb 1, 2013 at 12:50 AM, jimweaver <weaver.je at gmail.com> wrote:

> 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.
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20130201/3096b199/attachment.html>


More information about the slf4j-user mailing list