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

slf4j: class path contains multiple slf4j bindings.
how to remove multiple slf4j bindings
slf4j: no slf4j providers were found
loggerfactory is not a logback loggercontext but logback is on the classpath
log4j over slf4j spark
java lang runtimeexception slf4j: class path contains multiple slf4j bindings
slf4j this version of slf4j requires log4j version 1.2 1.2 or later
slf4j class path contains multiple slf4j bindings gradle

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) ;

    }

}

Here I am getting an error

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

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> 

This solved same problem with slf4j and Dozer.

SLF4J Error Codes, Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError . The purpose of slf4j-log4j12 module is to delegate or  log4j-over-slf4j.jar and slf4j-log4j12.jar conflitct… but i don't have log4j-over-slf4j 1 Phantom: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path,

[Solved] java.lang.IllegalStateException: Detected both log4j-over , jar AND bound slf4j-log4j12. jar on the class path. This IllegalStateException for these jar conflict happens when you choose library in you class path that are internally use log4j and slf4j. In theory, If you are using log4j for logging, you could simply exclude the log4j-over-slf4j. If SLF4J is bound withslf4j-log4j12.jar and log4j-over-slf4j.jar is also present on the class path, a StackOverflowError will inevitably occur immediately after the first invocation of an SLF4J or a log4j logger. My question is how to prevent this error if there are two libraries which I am using contain these jars? java logging ant jar

Encountered a similar error, this how I resolved it:

  1. Access Project explorer view on Netbeans IDE 8.2. Proceed to your project under Dependencies hover the cursor over the log4j-over-slf4j.jar to view the which which dependencies have indirectly imported as shown below.

  2. Right click an import jar file and select Exclude Dependency

  3. To confirm, open your pom.xml file you will notice the exclusion element as below.

4. Initiate maven clean install and run your project. Good luck!

both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path , IllegalStateException Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. See also  Multiple bindings were found on the class path & Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path Hot Network Questions Build Tower refactoring code is it necessary

And for SBT : excludeDependencies += "log4j" % "log4j"

[Solved]: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on , SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. SLF4J: See also  Phoenix; PHOENIX-1233; Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError

I got the solution

download Xuggler 5.4 here

and some more jar to make it work...

commons-cli-1.1.jar

commons-lang-2.1.jar

logback-classic-1.0.0.jar

logback-core-1.0.0.jar

slf4j-api-1.6.4.jar

You can check which dependencies xuggler needs from here:

Add this jars and xuggle-xuggler-5.4.jar to your project's build path and it s ready.

**version numbers may change

[PDF] SLF4J i, Here I am getting an error "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError.". Solution:. Siebel CRM - Version 8.1.1.14 [IP2014] and later: SCOA startup failed on TomCat with SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class pat

SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12 , Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path . class path, preempting StackOverflowError. SLF4J: See also  Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. Solution: So you have to exclude conflict dependencies.

SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the , SLF4J: Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path, preempting StackOverflowError. SLF4J: See also  If SLF4J is bound withslf4j-log4j12.jar and log4j-over-slf4j.jar is also present on the class path, a StackOverflowError will inevitably occur immediately after the first invocation of an SLF4J or a log4j logger.

lang.IllegalStateException: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.​jar on the class path, preempting StackOverflowError. See also  Detected both log4j-over-slf4j.jar AND bound slf4j-log4j12.jar on the class path. To redirect the log4j logger calls to slf4j, you need to use log4j-over-slf4j.jar binding and if you want to redirect slf4j calls to log4j, you need to use slf4j-log4j12.jar binding. Therefore, you cannot have both in the classpath.

Comments
  • If you are using log4j, you could simply exclude the log4j-over-slf4j.jar. In theory using log4j and hacking other code to route the log4j calls to slf4j can lead to recursion and hence the strict check.
  • That is because some dependencies that you add will have the logs libraries of their choice and so cause conflicts.
  • You should also remove the log4j jar that has been added to your classpath. Check your lib folder of storm. Atleast it was the case with me.
  • I could only get a SpringBoot application after I added that.
  • In which <dependency> tag do we add this exclusion? I've tried in the 'spring-boot-starter-web' exclusions but did not work. Which dependency?
  • This is the exclusion that worked for me: <exclusions> <exclusion> <groupId>org.slf4j</groupId> <artifactId>*</artifactId> </exclusion> </exclusions>
  • I want to make my own encoder in java to convert live stream in flv from Flash Media Server to 3gp