如何修复异常:无法实例化SLF4J LoggerFactory? [英] How to fix exception: Failed to instantiate SLF4J LoggerFactory?

查看:4326
本文介绍了如何修复异常:无法实例化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:


  1. 无法实例化SLF4J LoggerFactory
    报告的异常:
    java.lang .NoClassDefFoundError:org / apache / log4j / Level

  1. 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屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆