Log4J fails to initialize in an isolated deployment

Solution Verified - Updated -

Issue

  • A deployment that configures an isolated Log4J environment throwing the following error upon deployment. Why is this happening and how to fix it?
log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
log4j:ERROR [BaseClassLoader@2fecdb1b{vfszip:/app/jboss-eap-5.1.2/jboss-as/server/default/deploy//your-deployment.ear/}] whereas object of type
log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [BaseClassLoader@2bc68b6f{vfsfile:/app/jboss-eap-5.1.2/jboss-as/server/default/conf/jboss-service.xml}].
log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
log4j:WARN No appenders could be found for logger (some.class.that.uses.log4j.ClassName).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
  • How the log4j is related to the logging subsystem in standalone.xml file ?

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP)
    • 5.x
    • 6.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content