Unable to disable JBoss logging subsystem
chrkoelle Jun 12, 2012 3:07 AMHi
I have a problem with disabling the logging subsystem ind JBoss 7.1.1. The reason why we want to do this is a bug in the logging subsystem that causes performance problems:
https://community.jboss.org/thread/198196
https://issues.jboss.org/browse/LOGMGR-38
To do this I followed the descriptions in this article:
https://docs.jboss.org/author/display/AS71/How+To
Unfortunately this seems not to work completely. I get the following error messages during server start:
08:42:13,787 ERROR [stderr] log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
08:42:13,790 ERROR [stderr] log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
08:42:13,790 ERROR [stderr] log4j:ERROR [ModuleClassLoader for Module "deployment.myapp.ear:main" from Service Module Loader] whereas object of type
08:42:13,796 ERROR [stderr] log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [ModuleClassLoader for Module "org.apache.log4j:main" from local module loader @d233caf (roots: /opt/jboss7/modules)].
08:42:13,796 ERROR [stderr] log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
08:42:13,805 ERROR [stderr] log4j:WARN No appenders could be found for logger (myapp.MyClass).
08:42:13,805 ERROR [stderr] log4j:WARN Please initialize the log4j system properly.
And after that a lot of loader constraint violations:
Caused by: java.lang.LinkageError: loader constraint violation: when resolving field "logger" the class loader (instance of org/jboss/modules/ModuleClassLoader) of the referring class, myapp/MyClass, and the class loader (instance of org/jboss/modules/ModuleClassLoader) for the field's resolved type, s/ModuleClassLoader, have different Class objects for that type
I seems to me that the logging module is still used despite the configuration changes that should prevent the using of the subsystem.
Any hints?
Christian
PS: I have completely removed the subsystem in the standalone.xml and added a jboss-deployment-structure.xml in the META-INF directory of my ear with the following content:
<jboss-deployment-structure>
<deployment>
<!-- Exclusions allow you to prevent the server from automatically adding some dependencies -->
<exclusions>
<module name="org.apache.log4j" />
</exclusions>
</deployment>
</jboss-deployment-structure>