java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder maven

java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder maven

Hi,

I have a maven web application and I am trying to run it but its giving following error:

java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

How to resolve the error?

Thanks

View Answers

May 31, 2014 at 10:27 AM

Hi,

You should add the following code into pom.xml file:

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.6</version>
    </dependency>

This will solve the problem.

Usually following error comes if the dependency is not satisfied:

Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
        at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:189)
        at org.slf4j.LoggerFactory.bind(LoggerFactory.java:112)
        at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:105)
        at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:235)
        at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:208)
        at org.hibernate.validator.util.LoggerFactory.make(LoggerFactory.java:29)
        at org.hibernate.validator.util.Version.<clinit>(Version.java:30)
        at org.hibernate.validator.engine.ConfigurationImpl.<clinit>(ConfigurationImpl.java:52)
        at org.hibernate.validator.HibernateValidator.createGenericConfiguration(HibernateValidator.java:43)
        at javax.validation.Validation$GenericBootstrapImpl.configure(Validation.java:269)
        at org.springframework.validation.beanvalidation.LocalValidatorFactoryBean.afterPropertiesSet(LocalValidatorFactoryBean.java:223)
        at org.springframework.validation.beanvalidation.OptionalValidatorFactoryBean.afterPropertiesSet(OptionalValidatorFactoryBean.java:40)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1612)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1549)
        ... 60 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
        at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
        at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
        ... 74 more
[WARNING] failed dispatcher

Thanks


May 31, 2014 at 10:27 AM

The above answer is really helpful in solving the error:

java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder

Thanks









Related Tutorials/Questions & Answers:
Maven - Maven
Maven  I am new to maven tool.i don't know anything abt that? plesae explain me about maven   Hi mamatha, Maven is a high-level... software foundation group. Maven deals with application development lifecycle
Artifacts of maven
List of Artifacts of maven maven depenency
Advertisements
Version of maven>maven dependency
List of Version of maven>maven dependency
Maven Repository/Dependency: maven | maven
Maven Repository/Dependency of Group ID maven and Artifact ID maven. Latest version of maven:maven dependencies. # Version... 02 Aug 2005 You can read more at: Maven Tutorials
Maven Dependency maven >> 1.0
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0 in your project
Maven Dependency maven >> 1.0.1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0.1 in your project
Maven Dependency maven >> 1.0.2
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0.2 in your project
Maven Dependency maven >> 1.0-beta-10
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-10 in your project
Maven Dependency maven >> 1.0-beta-5
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-5 in your project
Maven Dependency maven >> 1.0-beta-6
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-6 in your project
Maven Dependency maven >> 1.0-beta-7
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-7 in your project
Maven Dependency maven >> 1.0-beta-8
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-8 in your project
Maven Dependency maven >> 1.0-beta-8.20021007.010812
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-8.20021007.010812 in your project
Maven Dependency maven >> 1.0-beta-8.20030202.153444
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-8.20030202.153444 in your project
Maven Dependency maven >> 1.0-beta-8.20030202.153715
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-8.20030202.153715 in your project
Maven Dependency maven >> 1.0-beta-8.20030202.153859
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-beta-8.20030202.153859 in your project
Maven Dependency maven >> 1.0-rc1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-rc1 in your project
Maven Dependency maven >> 1.0-rc2
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-rc2 in your project
Maven Dependency maven >> 1.0-rc3
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-rc3 in your project
Maven Dependency maven >> 1.0-rc4
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.0-rc4 in your project
Maven Dependency maven >> 1.1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.1 in your project
Maven Dependency maven >> 1.1-beta-1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.1-beta-1 in your project
Maven Dependency maven >> 1.1-beta-2
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.1-beta-2 in your project
Maven Dependency maven >> 1.1-beta-3
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.1-beta-3 in your project
Maven Dependency maven >> 1.1-RC1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version1.1-RC1 in your project
Maven Dependency maven >> 20030211.132709
You should include the dependency code given in this page to add Maven Dependency of maven >> maven version20030211.132709 in your project
Version of maven>maven-component dependency
List of Version of maven>maven-component dependency
Version of maven>maven-it-support dependency
List of Version of maven>maven-it-support dependency
Version of maven>maven-model dependency
List of Version of maven>maven-model dependency
Maven Jobss Plugin - Maven
Maven Jobss Plugin  How to deploy your application using maven tool.... So, to make the things simple we used jboss-maven-plugin to deploy... org.codehaus.mojo jboss-maven-plugin  Hi, I was working on a project where
Maven 2 - Maven
Maven 2   Hi, I m new to Maven 2 and in process to implement Maven2. I have browse in the net and got my Maven 2 installed but now I m facing few concerns on creating a small project. Please help me in this regard Thanks
Maven Repository/Dependency: maven | maven-model
Maven Repository/Dependency of Group ID maven and Artifact ID maven-model. Latest version of maven:maven-model dependencies. # Version... You can read more at: Maven Tutorials What
Maven Repository/Dependency: maven | maven-component
Maven Repository/Dependency of Group ID maven and Artifact ID maven-component. Latest version of maven:maven-component dependencies. # Version Release Date You can read more at: Maven
Maven Repository/Dependency: maven | maven-it-support
Maven Repository/Dependency of Group ID maven and Artifact ID maven-it-support. Latest version of maven:maven-it-support dependencies... at: Maven Tutorials What is Apache Maven? How to create Maven Web
Maven Dependency maven-component >> 2.0-SNAPSHOT
You should include the dependency code given in this page to add Maven Dependency of maven >> maven-component version2.0-SNAPSHOT in your project
Maven Dependency maven-it-support >> 1.0
You should include the dependency code given in this page to add Maven Dependency of maven >> maven-it-support version1.0 in your project
Maven Dependency maven-model >> 3.0.0
You should include the dependency code given in this page to add Maven Dependency of maven >> maven-model version3.0.0 in your project
Maven Dependency maven-model >> 3.0.1
You should include the dependency code given in this page to add Maven Dependency of maven >> maven-model version3.0.1 in your project
Maven Dependency maven-model >> 3.0.2
You should include the dependency code given in this page to add Maven Dependency of maven >> maven-model version3.0.2 in your project
Maven Exclusion - Maven
Maven Exclusion  While doing a project I was encountered a problem... jsf-api-1.2_06.jar jsf-impl-1.2_06.jar Here is the full code of maven-war plugin maven-war-plugin 2.0.2 **/jdbc.properties   Hello,My problem
Artifacts of cactus-maven
List of Artifacts of cactus-maven maven depenency
Artifacts of maven-clover-plugin
List of Artifacts of maven-clover-plugin maven depenency
Artifacts of maven-cruisecontrol-plugin
List of Artifacts of maven-cruisecontrol-plugin maven depenency
Artifacts of maven-dashboard-plugin
List of Artifacts of maven-dashboard-plugin maven depenency
Artifacts of maven-ear-plugin
List of Artifacts of maven-ear-plugin maven depenency
Artifacts of maven-ejb-plugin
List of Artifacts of maven-ejb-plugin maven depenency
Artifacts of maven-gump-plugin
List of Artifacts of maven-gump-plugin maven depenency
Artifacts of maven-java-plugin
List of Artifacts of maven-java-plugin maven depenency
Artifacts of maven-multiproject-plugin
List of Artifacts of maven-multiproject-plugin maven depenency
Artifacts of maven-javanet-plugin
List of Artifacts of maven-javanet-plugin maven depenency

Ads