slf4j:detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar on the class path, preempting stackoverflowerror.
Slf4j:see also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
Exception in thread "main" Java.lang.ExceptionInInitializerError
At Org.apache.log4j.LogManager.getLogger (logmanager.java:44)
At Org.slf4j.impl.Log4jLoggerFactory.getLogger (log4jloggerfactory.java:66)
At Org.slf4j.LoggerFactory.getLogger (loggerfactory.java:277)
At Org.slf4j.LoggerFactory.getLogger (loggerfactory.java:288)
....
caused by:java.lang.IllegalStateException:Detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar on the class pat H, preempting Stackoverflowerror. See also Http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
At org.apache.log4j.log4jloggerfactory.<clinit> (log4jloggerfactory.java:51)
... One More
The reason is to refer to two jars about log4j, causing a dead loop
Log4j-over-slf4j-1.7.7.jar
Slf4j-log4j12-1.7.7.jar
But referring to Slf4j-log4j12-1.7.7.jar will prompt org.apache.log4j.Level This class cannot find
To use log4j logging, you can actually use reference Log4j-over-slf4j-1.7.7.jar only, and you can generally exclude references to log4j when you introduce other dependencies in Maven:
<exclusion> <groupid>log4j</groupid> <artifactid>log4j</artifactid></ exclusion><exclusion> <groupid>org.slf4j</groupid> <artifactId> Elf4j-log4j12</artifactid></exclusion>
Common mistakes developed: detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar