Log4j Initialization Error in WebServices Deploy With prefer-web-inf-classes=true
(Doc ID 2266334.1)
Last updated on APRIL 13, 2021
Applies to:Oracle WebLogic Server - Version 184.108.40.206.0 to 220.127.116.11.0 [Release 12c]
Information in this document applies to any platform.
Apache log4j initialization error is generated when WebServices is deployed and initialized.
When log4j.jar is existing in both the system classpath and WEB-INF/lib, and prefer-web-inf-classes is true in weblogic.xml.
Classes in log4j.jar should be loaded from WEB-INF/lib but it is loaded from system classpath when WebServices is deployed. Then the following log4j error is logged.
log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
log4j:ERROR [weblogic.utils.classloaders.ChangeAwareClassLoader@1101154 finder: weblogic.utils.classloaders.CodeGenClassFinder@745d25 annotation: testcase3_log4j@testcase3_log4j] whereas object of type
log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [sun.misc.Launcher$AppClassLoader@1a462c9].
log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
To view full details, sign in with your My Oracle Support account.
Don't have a My Oracle Support account? Click to get started!
In this Document