在类路径上检测到log4j-over-slf4j.jar和slf4j-log4j12.jar,抢占StackOverflowError。 [英] Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.

查看:1875
本文介绍了在类路径上检测到log4j-over-slf4j.jar和slf4j-log4j12.jar,抢占StackOverflowError。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用 xuggle library 将视频从 mp4转码为flv
我用 slf4j库也支持记录结束。

I have used xuggle library in my project to trans code the video from mp4 to flv. I have used slf4j libraries also to support logging end.

import com.xuggle.mediatool.IMediaReader;
import com.xuggle.mediatool.IMediaViewer;
import com.xuggle.mediatool.IMediaWriter;
import com.xuggle.mediatool.ToolFactory;

public class TranscodingExample {

    private static final String inputFilename = "E:\\VIDEO\\Facebook.mp4";
    private static final String outputFilename = "E:\\VIDEO\\Facebook.flv";

    public static void main(String[] args) {

        // create a media reader
        IMediaReader mediaReader = 
               ToolFactory.makeReader(inputFilename);

        // create a media writer
        IMediaWriter mediaWriter = 
               ToolFactory.makeWriter(outputFilename, mediaReader);

        // add a writer to the reader, to create the output file
        mediaReader.addListener(mediaWriter);

        // create a media viewer with stats enabled
        IMediaViewer mediaViewer = ToolFactory.makeViewer(true);

        // add a viewer to the reader, to see the decoded media
        mediaReader.addListener(mediaViewer);

        // read and decode packets from the source file and
        // and dispatch decoded audio and video to the writer
        while (mediaReader.readPacket() == null) ;

    }

}

我在这里收到错误

"Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.". 

我已将两个jar文件用作库以解决日志记录问题。
是否有人遇到同样的问题。如果善意写出建议或解决方案来摆脱这个烂摊子。
提前致谢。

I have used both jar files as libraries in order to solve logging problems. Does any one faced the same problem.If so kindly write suggestion or solution to come out of this mess. Thanks in advance.

推荐答案

所以你必须排除冲突依赖。试试这个:

So you have to exclude conflict dependencies. Try this:

<exclusions>
  <exclusion> 
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-log4j12</artifactId>
  </exclusion>
  <exclusion> 
    <groupId>log4j</groupId>
    <artifactId>log4j</artifactId>
  </exclusion>
</exclusions> 

这解决了slf4j和Dozer的相同问题。

This solved same problem with slf4j and Dozer.

这篇关于在类路径上检测到log4j-over-slf4j.jar和slf4j-log4j12.jar,抢占StackOverflowError。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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