Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Intro to Java Web Development with Spark Diving into Web Development Cookies

Jordan George
Jordan George
9,926 Points

"SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"." error/notification....?

Why am I getting this in red?

"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."

3 Answers

are you running dependency spark version 2.3 like craig? or are you using the most up to date version? I was using 2.5 and recieved the same error. The answer was posted a few videos ago i believe but the gist of it was

add

compile 'org.slf4j:slf4j-simple:1.7.21'

to your list of dependencies if it is not already there

Jordan George
Jordan George
9,926 Points

Thanks! That worked. I am using the most up to date version and added the dependency line.

You need to include an slf4j logging implementation in your dependencies.

For gradle, here is what I have for my dependencies:

dependencies {
    compile 'com.sparkjava:spark-core:2.9.3'
    compile group: 'org.slf4j', name: 'slf4j-jdk14', version: '1.7.29'
    testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0'
    testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
}

For maven, this is what I have for my dependencies:

<dependencies>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-core</artifactId>
            <version>2.5</version>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-jdk14</artifactId>
            <version>1.7.30</version>
        </dependency>
        <dependency>
            <groupId>com.sparkjava</groupId>
            <artifactId>spark-template-handlebars</artifactId>
            <version>2.7.1</version>
        </dependency>
 </dependencies>