Detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar on the class path, preempting stackoverflowerror

Source: Internet
Author: User

caused by:java.lang.IllegalStateException:Detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar on the class path, PR Eempting Stackoverflowerror

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 path, PR Eempting 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 only the reference Log4j-over-slf4j-1.7.7.jar.

Workaround: Delete the SLF4J-LOG4J12 package, including the MyEclipse workspace

Detected both Log4j-over-slf4j.jar and Slf4j-log4j12.jar on the class path, preempting stackoverflowerror

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.