Java 如何从apachezip的多个绑定中找到特定的org/slf4j/Logger jar文件?

Java 如何从apachezip的多个绑定中找到特定的org/slf4j/Logger jar文件?,java,apache,logging,file-io,Java,Apache,Logging,File Io,我使用的是ApachePDFBox&POIFSFilesystem,它从PDF中提取文本并导出到excel中,但我的应用程序在添加Apache-log4j-2.8.2-bin jar文件后出现以下错误。我尝试添加org/slf4j/Logger jar文件,但仍然抛出错误。可能是我找不到确切的文件。。!请建议 Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger at org.apache.

我使用的是ApachePDFBox&POIFSFilesystem,它从PDF中提取文本并导出到excel中,但我的应用程序在添加Apache-log4j-2.8.2-bin jar文件后出现以下错误。我尝试添加org/slf4j/Logger jar文件,但仍然抛出错误。可能是我找不到确切的文件。。!请建议

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/Logger
    at org.apache.logging.slf4j.SLF4JLoggerContext.getLogger(SLF4JLoggerContext.java:39)
    at org.apache.logging.log4j.jcl.LogAdapter.newLogger(LogAdapter.java:34)
    at org.apache.logging.log4j.jcl.LogAdapter.newLogger(LogAdapter.java:30)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:52)
    at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:40)
    at org.apache.logging.log4j.jcl.LogFactoryImpl.getInstance(LogFactoryImpl.java:55)
    at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:655)
    at org.apache.pdfbox.pdmodel.PDDocument.<clinit>(PDDocument.java:80)
java.lang.NoClassDefFoundError

通常意味着没有正确提供jar文件。从下载slf4j jar文件,然后重试。
另外,最好使用类似的方法来解决所有依赖关系,这样就可以避免这些问题。

我只能使用添加jar而不是maven。我在添加slf4j JAR后更新了错误。我认为错误已经足够详细了<代码>SLF4J:请参阅http://www.slf4j.org/codes.html#multiple_bindings 有关说明您是否能够检查此链接并查看是否有多余的JAR?
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/D:/apache-log4j-2.8.2-bin/log4j-slf4j-impl-2.8.2.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-android-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-jcl-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-jdk14-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-nop-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/D:/slf4j-1.7.25/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Exception in thread "main" java.lang.StackOverflowError
    at org.apache.logging.log4j.LogManager.getContext(LogManager.java:194)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getContext(AbstractLoggerAdapter.java:122)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getContext(Log4jLoggerFactory.java:43)
    at org.apache.logging.log4j.spi.AbstractLoggerAdapter.getLogger(AbstractLoggerAdapter.java:46)
    at org.apache.logging.slf4j.Log4jLoggerFactory.getLogger(Log4jLoggerFactory.java:29)