Posts

Showing posts with the label Slf4J

ClassNotFoundException: Org.slf4j.LoggerFactory

Answer : 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): slf4j-api-1.7.2.jar slf4j-simple-1.7.2.jar I was able to run my program. Try downloading jar from here You can find, it holds the class you need. EDIT Seems like the website has changed its structure. You need to choose which jar file you need for your project. For slf4j-api jar file for latest version as of now, please visit this link For slf4j-simple jar file for latest version as of now, please visit this link For a bit more explanation: keep in mind that the "I" in "api" is interface. The slf4j-api jar only holds the needed interfaces (actually LoggerFactory is an abstract class). You als...

Building With Lombok's @Slf4j And Eclipse: Cannot Find Symbol Log

Answer : You also have to install Lombok into Eclipse. See also this answer on how to do that or check if Lombok is installed correctly. Full Disclosure: I am one of the Project Lombok developers. I got the same error even after Lombok was installed. For me the solution was to add another lombok annotation (i used @Data) to my class after which the eclipse errors went away. Perhaps this force refreshed some cache. Of course, I simply deleted the @Data annotation afterwards. I also faced the similar issue on log and @Slf4j on my STS environment. To resolve this, here is what I did on spring tool suite (sts-4.4.0.RELEASE) and lombok-1.18.10.jar (current latest version available in mavenrepository). If having maven project, ensure lombok dependency added to it. Else you need manually add the jar to your project classpath. <!-- https://mvnrepository.com/artifact/org.projectlombok/lombok --> <dependency> <groupId>org.projectlombok</groupId> <artifa...