I am trying to write a java web crawler for semantic web using jena library. I have build project using Netbeans. I am receiving two errors:
Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: org/apache/log4j/Level
Could not initialize class com.hp.hpl.jena.rdf.model.impl.ModelCom at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
I have included slf4j-api
and slf4j-log
both libraries.
The org. slf4j. Logger interface is the main user entry point of SLF4J API. It is expected that logging takes place through concrete implementations of this interface.
So essentially, SLF4J does not replace Log4j, Both work together. SLF4j removes the tight coupling between the application and logging frameworks. It makes it easy to replace with any other logging framework in the future with a more capable library.
SLF4J standardized the logging levels, which are different for the particular implementations. It drops the FATAL logging level (introduced in Log4j) based on the premise that in a logging framework we should not decide when to terminate an application. The logging levels used are ERROR, WARN, INFO, DEBUG and TRACE.
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.
You should also include log4j
library as slf4j-log4j
is just a static binder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With