如何修复异常:无法实例化SLF4J LoggerFactory? [英] How to fix exception: Failed to instantiate SLF4J LoggerFactory?
问题描述
我正在尝试使用jena库为语义Web编写一个java Web爬虫。我使用Netbeans构建项目。我收到两个错误:
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:
-
无法实例化SLF4J LoggerFactory
报告的异常:
java.lang .NoClassDefFoundError:org / apache / log4j / Level
Failed to instantiate SLF4J LoggerFactory Reported exception: java.lang.NoClassDefFoundError: org/apache/log4j/Level
无法初始化类com.hp.hpl.jena.rdf.model.impl.ModelCom
org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
Could not initialize class com.hp.hpl.jena.rdf.model.impl.ModelCom at org.slf4j.LoggerFactory.bind(LoggerFactory.java:128)
我已经包含了 slf4j-api
和 slf4j-log
两个库。
I have included slf4j-api
and slf4j-log
both libraries.
推荐答案
您还应该包含 log4j
库,因为 slf4j-log4j
只是一个静态绑定器。
You should also include log4j
library as slf4j-log4j
is just a static binder.
这篇关于如何修复异常:无法实例化SLF4J LoggerFactory?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!