简体   繁体   English

XUGGLE ERROR:线程“main”中的异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory

[英]XUGGLE ERROR: Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

I am trying to execute the following code: 我正在尝试执行以下代码:

import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;
public class vidcon {

    /**
     * @param args
     */
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        IMediaReader reader = ToolFactory.makeReader("test.m4v");
        IMediaWriter writer = ToolFactory.makeWriter("out.flv");

        reader.addListener(writer);
        while(reader.readPacket() == null)
            ;
    }
}

But it is is giving me this error: 但这是给我这个错误:

Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
    at com.xuggle.ferry.JNILibrary.<clinit>(JNILibrary.java:42)
    at com.xuggle.ferry.FerryJNI.<clinit>(FerryJNI.java:14)
    at com.xuggle.ferry.Ferry.<clinit>(Ferry.java:25)
    at com.xuggle.xuggler.XugglerJNI.<clinit>(XugglerJNI.java:19)
    at com.xuggle.xuggler.IContainer.<clinit>(IContainer.java:1622)
    at com.xuggle.mediatool.MediaReader.<init>(MediaReader.java:137)
    at com.xuggle.mediatool.ToolFactory.makeReader(ToolFactory.java:77)
    at vidcon.main(vidcon.java:11)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.net.URLClassLoader$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    ... 8 more

I have added SLF4J to my referenced libraries, but have no idea why this is not working. 我已将SLF4J添加到我引用的库中,但不知道为什么这不起作用。

Running on WIN 7, tried in eclipse and netbeans 在WIN 7上运行,在eclipse和netbeans中尝试过

Any idea? 任何的想法?

下载SLF4J并将slf4j-api-1.7.2.jar文件放到类路径上。

The following combination of jars is working for me: 以下罐子组合对我有用:

log4j-1.2.16.jar log4j的-1.2.16.jar
slf4j-api-1.7.6.jar SLF4J-API-1.7.6.jar
slf4j-simple-1.7.6.jar SLF4J-简单1.7.6.jar
xuggle-xuggler-5.4.jar xuggle-xuggler-5.4.jar

Cause Could be un-availability of dependency jars or version conflicts. 原因可能是依赖项jar或版本冲突不可用。

The following jars combination worked fine for me: 以下罐子组合对我来说很好:

xuggle-xuggler-5.4.jar xuggle-xuggler-5.4.jar
slf4j-api-1.6.4.jar SLF4J-API-1.6.4.jar
logback-core-1.0.0.jar 的logback核-1.0.0.jar
logback-classic-1.0.0.jar 的logback经典-1.0.0.jar

you might be added the apache-log4j-2.7-bin jars. 你可能会添加apache-log4j-2.7-bin jar。 Just Remove all those Jars and keep only 只需删除所有这些罐子并保留

log4j-1.2.16.jar
slf4j-api-1.7.6.jar
slf4j-simple-1.7.6.jar
xuggle-xuggler-5.4.jar

Download SLF4J and put the slf4j-api-1.7.25.jar, slf4j-simple-1.7.25.jar files into application class path. 下载SLF4J并将slf4j-api-1.7.25.jar,slf4j-simple-1.7.25.jar文件放入应用程序类路径中。

This will help to resolve this exception along with following exception SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". 这将有助于解决此异常以及以下异常SLF4J:无法加载类“org.slf4j.impl.StaticLoggerBinder”。

Check your configuration file (.xml file). 检查配置文件(.xml文件)。 The first line in this must start with the declaration of XML version and encoding. 其中的第一行必须从XML版本和编码的声明开始。

Otherwise, you will get the same error util unless you have included all the required .jar files. 否则,除非包含所有必需的.jar文件,否则将获得相同的错误util。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Java:线程“ main”中的异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Java: Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory Spring工具套件中的线程“ main”中的异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory in Spring tool suite Gradle-线程“ main”中的异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Gradle - Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory 线程“ main”中的Gradle异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Gradle Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory RabbitMQ - 线程“main”中的异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - RabbitMQ - Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory Java + Maven +在线程“main”中生成可执行jar +异常java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Java + Maven + make executable jar + Exception in thread “main” java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory Slf4j 和 Logback 错误:java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory - Slf4j and Logback error: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory java.lang.NoClassDefFoundError: OSGi 中的 org/slf4j/LoggerFactory - java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory in OSGi 休眠-java.lang.NoClassDefFoundError:org / slf4j / LoggerFactory - Hibernate - java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory 问题 - java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory problem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM