Log4J not really excluded in JBoss EAP6/AS7

无人久伴 提交于 2019-12-24 06:55:11

问题


In jboss-deployment-structure.xml from application war file, I have exclude log4j modules or so

<?xml version="1.0" encoding="UTF-8"?>
<jboss-deployment-structure xmlns="urn:jboss:deployment-structure:1.0">
<deployment>
    <dependencies>
        <module name="oracle" />
    </dependencies>
    <exclusions>
        <module name="org.apache.log4j" />
        <module name="org.apache.commons.logging" />
        <module name="org.jboss.logging" />
        <module name="org.jboss.logging.jul-to-slf4j-stub" />
        <module name="org.jboss.logmanager" />
        <module name="org.jboss.logmanager.log4j" />
        <module name="org.slf4j" />
    </exclusions>
</deployment>
</jboss-deployment-structure>

It should be fine, but when deploy and start the application, I got this error:

21:46:28,661 ERROR [stderr] (MSC service thread 1-1) log4j:ERROR A "org.apache.log4j.RollingFileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.

21:46:28,662 ERROR [stderr] (MSC service thread 1-1) log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 

21:46:28,662 ERROR [stderr] (MSC service thread 1-1) log4j:ERROR [ModuleClassLoader for Module "org.jboss.log4j.logmanager:main" from local module loader @656de49c (roots: D:\JAVA\EAP-6.0.0.GA\jboss-eap-6.0\modules)] whereas object of type 

21:46:28,662 ERROR [stderr] (MSC service thread 1-1) log4j:ERROR "org.apache.log4j.RollingFileAppender" was loaded by [ModuleClassLoader for Module "deployment.your-application.war:main" from Service Module Loader].

21:46:28,663 ERROR [stderr] (MSC service thread 1-1) log4j:ERROR Could not instantiate appender named "ROL".

This really really annoying as I just be a good boy to do what it supposed to, but master jboss just play trick with me....

Any hints are appreciated.

来源:https://stackoverflow.com/questions/16682293/log4j-not-really-excluded-in-jboss-eap6-as7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!