Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ClassNotFoundException: org.slf4j.LoggerFactory

Tags:

java

slf4j

gwt

I am trying to run GWT RequestFactory and facing this error:

ClassNotFoundException: org.slf4j.LoggerFactory 

I have tried to download slf4j-api-1.3.1.jar but it didnt resolve the issue

Any idea exactly which jar I need to download ?

like image 406
junaidp Avatar asked Jan 27 '12 07:01

junaidp


People also ask

What is SLF4J LoggerFactory?

The LoggerFactory class of the org. slf4j package is a utility class, which is used to generate loggers for various logging APIs such as log4j, JUL, NOP and simple logger.

What is LoggerFactory in Java?

The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for log4j, logback and JDK 1.4 logging. Other implementations such as NOPLogger and SimpleLogger are also supported.

Can I use log4j without SLF4J?

So essentially, SLF4J does not replace log4j; they both work together. It removes the dependency on log4j from your application and makes it easy to replace it in the future with the more capable library.


1 Answers

Better to always download as your first try, the most recent version from the developer's site

I had the same error message you had, and by downloading the jar from the above (slf4j-1.7.2.tar.gz most recent version as of 2012OCT13), untarring, uncompressing, adding 2 jars to build path in eclipse (or adding to classpath in comand line):

  1. slf4j-api-1.7.2.jar
  2. slf4j-simple-1.7.2.jar

I was able to run my program.

like image 72
CharlieL Avatar answered Oct 02 '22 07:10

CharlieL