Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to load class "org.slf4j.impl.StaticLoggerBinder" error

I'm getting "Failed to load class "org.slf4j.impl.StaticLoggerBinder" error despite I folowed the rule:

Placing one (and only one) of slf4j-nop.jar, slf4j-simple.jar, slf4j-log4j12.jar, slf4j-jdk14.jar or logback-classic.jar

I'll be so happy if someone can help me, thanks in advance..


Here's my dependencies:

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>${slf4j.version}</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>${slf4j.version}</version>
    </dependency>

    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.15</version>
        <exclusions>
            <exclusion>
                <groupId>com.sun.jmx</groupId>
                <artifactId>jmxri</artifactId>
            </exclusion>
            <exclusion>
                <groupId>com.sun.jdmk</groupId>
                <artifactId>jmxtools</artifactId>
            </exclusion>
            <exclusion>
                <groupId>javax.jms</groupId>
                <artifactId>jms</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

Here's the output of maven dependency tree:

[INFO] com.tk.sample:ext4:jar:1.0
[INFO] +- org.slf4j:slf4j-api:jar:1.6.1:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.6.1:compile
[INFO] +- log4j:log4j:jar:1.2.15:compile
[INFO] |  \- javax.mail:mail:jar:1.4:compile
[INFO] |     \- javax.activation:activation:jar:1.1:compile
[INFO] +- commons-lang:commons-lang:jar:2.5:compile
[INFO] +- junit:junit:jar:4.8.2:test (scope not updated to compile)
[INFO] +- org.easymock:easymock:jar:3.0:test
[INFO] |  \- org.objenesis:objenesis:jar:1.2:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- taglibs:standard:jar:1.1.2:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.springframework:spring-core:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-expression:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-beans:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-asm:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-aop:jar:3.1.1.RELEASE:compile
[INFO] |  \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-web:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-tx:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-jdbc:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.1.1.RELEASE:compile
[INFO] |  \- org.springframework:spring-context-support:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-orm:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-oxm:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-jms:jar:3.1.1.RELEASE:compile
[INFO] +- org.springframework:spring-test:jar:3.1.1.RELEASE:compile
[INFO] +- cglib:cglib-nodep:jar:2.2.2:runtime
[INFO] +- org.aspectj:aspectjrt:jar:1.6.11:compile
[INFO] +- org.aspectj:aspectjweaver:jar:1.6.11:compile
[INFO] +- org.hibernate:hibernate-core:jar:4.1.1.Final:compile
[INFO] |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.0.GA:compile
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.1_spec:jar:1.0.0.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  +- org.javassist:javassist:jar:3.15.0-GA:compile
[INFO] |  \- org.hibernate.common:hibernate-commons-annotations:jar:4.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-c3p0:jar:4.1.1.Final:compile
[INFO] |  \- c3p0:c3p0:jar:0.9.1:compile
[INFO] +- org.hibernate.javax.persistence:hibernate-jpa-2.0-api:jar:1.0.1.Final:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.1.1.Final:compile
[INFO] +- net.sf.json-lib:json-lib:jar:jdk15:2.4:compile
[INFO] |  +- commons-beanutils:commons-beanutils:jar:1.8.0:compile
[INFO] |  +- commons-collections:commons-collections:jar:3.2.1:compile
[INFO] |  \- net.sf.ezmorph:ezmorph:jar:1.0.6:compile
[INFO] +- mysql:mysql-connector-java:jar:5.1.20:compile
[INFO] +- commons-io:commons-io:jar:1.3.2:compile
[INFO] +- commons-fileupload:commons-fileupload:jar:1.2.1:compile
[INFO] +- commons-dbcp:commons-dbcp:jar:1.4:compile
[INFO] |  \- commons-pool:commons-pool:jar:1.5.4:compile
[INFO] +- javax.xml:jaxrpc-api:jar:1.1:compile
[INFO] +- commons-discovery:commons-discovery:jar:0.4:compile
[INFO] +- javax.transaction:jta:jar:1.1:compile
[INFO] +- commons-logging:commons-logging:jar:1.1.1:compile
[INFO] +- com.itextpdf:itextpdf:jar:5.3.0:compile
[INFO] +- net.sf.jasperreports:jasperreports:jar:4.6.0:compile
[INFO] |  +- commons-digester:commons-digester:jar:2.1:compile
[INFO] |  +- com.lowagie:itext:jar:2.1.7:compile
[INFO] |  |  +- bouncycastle:bcmail-jdk14:jar:138:compile
[INFO] |  |  +- bouncycastle:bcprov-jdk14:jar:138:compile
[INFO] |  |  \- org.bouncycastle:bctsp-jdk14:jar:1.38:compile
[INFO] |  |     +- org.bouncycastle:bcprov-jdk14:jar:1.38:compile
[INFO] |  |     \- org.bouncycastle:bcmail-jdk14:jar:1.38:compile
[INFO] |  +- jfree:jcommon:jar:1.0.15:compile
[INFO] |  +- jfree:jfreechart:jar:1.0.12:compile
[INFO] |  +- xml-apis:xml-apis:jar:1.3.02:compile
[INFO] |  +- eclipse:jdtcore:jar:3.1.0:compile
[INFO] |  +- org.codehaus.castor:castor:jar:1.2:compile
[INFO] |  +- org.apache.poi:poi-ooxml:jar:3.7:compile
[INFO] |  |  +- org.apache.poi:poi:jar:3.7:compile
[INFO] |  |  \- org.apache.poi:poi-ooxml-schemas:jar:3.7:compile
[INFO] |  |     +- org.apache.xmlbeans:xmlbeans:jar:2.3.0:compile
[INFO] |  |     |  \- stax:stax-api:jar:1.0.1:compile
[INFO] |  |     \- org.apache.geronimo.specs:geronimo-stax-api_1.0_spec:jar:1.0:compile
[INFO] |  +- org.codehaus.jackson:jackson-core-asl:jar:1.9.4:compile
[INFO] |  \- org.codehaus.jackson:jackson-mapper-asl:jar:1.9.4:compile
[INFO] +- org.twitter4j:twitter4j-core:jar:2.2.5:compile
[INFO] \- org.codehaus.mojo:emma-maven-plugin:jar:1.0-alpha-3:compile
[INFO]    +- emma:emma:jar:2.1.5320:compile
[INFO]    +- org.apache.maven:maven-artifact:jar:2.0.8:compile
[INFO]    +- org.apache.maven:maven-plugin-api:jar:2.0:compile
[INFO]    +- org.apache.maven:maven-model:jar:2.0.8:compile
[INFO]    +- org.apache.maven:maven-project:jar:2.0.8:compile
[INFO]    |  +- org.apache.maven:maven-settings:jar:2.0.8:compile
[INFO]    |  +- org.apache.maven:maven-profile:jar:2.0.8:compile
[INFO]    |  +- org.apache.maven:maven-artifact-manager:jar:2.0.8:compile
[INFO]    |  |  +- org.apache.maven:maven-repository-metadata:jar:2.0.8:compile
[INFO]    |  |  \- org.apache.maven.wagon:wagon-provider-api:jar:1.0-beta-2:compile
[INFO]    |  +- org.apache.maven:maven-plugin-registry:jar:2.0.8:compile
[INFO]    |  \- org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-9-stable-1:compile
[INFO]    |     \- classworlds:classworlds:jar:1.1-alpha-2:compile
[INFO]    +- org.apache.maven.doxia:doxia-site-renderer:jar:1.0:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-core:jar:1.0:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-sink-api:jar:1.0:compile
[INFO]    |  +- org.codehaus.plexus:plexus-i18n:jar:1.0-beta-7:compile
[INFO]    |  +- org.codehaus.plexus:plexus-velocity:jar:1.1.7:compile
[INFO]    |  +- org.apache.velocity:velocity:jar:1.5:compile
[INFO]    |  |  \- oro:oro:jar:2.0.8:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-decoration-model:jar:1.0:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-module-apt:jar:1.0:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-module-fml:jar:1.0:compile
[INFO]    |  +- org.apache.maven.doxia:doxia-module-xdoc:jar:1.0:compile
[INFO]    |  \- org.apache.maven.doxia:doxia-module-xhtml:jar:1.0:compile
[INFO]    +- org.apache.maven.reporting:maven-reporting-api:jar:2.0.8:compile
[INFO]    +- org.apache.maven.reporting:maven-reporting-impl:jar:2.0.4.2:compile
[INFO]    |  \- commons-validator:commons-validator:jar:1.2.0:compile
[INFO]    +- org.codehaus.plexus:plexus-utils:jar:1.4.5:compile
[INFO]    \- xom:xom:jar:1.1:compile
[INFO]       +- xerces:xmlParserAPIs:jar:2.6.2:compile
[INFO]       +- xerces:xercesImpl:jar:2.6.2:compile
[INFO]       \- jaxen:jaxen:jar:1.1-beta-8:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Full error stacktrace:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
like image 554
talha06 Avatar asked Jul 20 '12 22:07

talha06


People also ask

What is SLF4J error?

impl. StaticLoggerBinder". This is a warning which is caused when there are no SLF4J bindings provided in the classpath. SLF4J: Failed to load class "org.

What is log4j over SLF4J?

log4j-over-slf4j. SLF4J ship with a module called log4j-over-slf4j. It allows log4j users to migrate existing applications to SLF4J without changing a single line of code but simply by replacing the log4j. jar file with log4j-over-slf4j.

What is SLF4J API jar?

API for SLF4J (The Simple Logging Facade for Java) which serves as a simple facade or abstraction for various logging frameworks, allowing the end user to plug in the desired logging framework at deployment time.

What is SLF4J jdk14?

slf4j is Simple Logging Facade for Java .


1 Answers

finally found the problem; the IDE that I'm using - IntelliJ Idea - needs to show slf4j dependencies explicitly to build artifacts. Thanks a lot for your care Ceki..

like image 88
talha06 Avatar answered Sep 18 '22 16:09

talha06