3 Replies Latest reply on Jul 12, 2012 1:14 PM by James Perkins

    log4j doesn't work in latest nightly

    Sergiu Pienar Apprentice

      I'm using JBoss AS 7.2.0.Alpha1-SNAPSHOT "Steropes" and getting such errors :

       

      06:08:45,088 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-12) JBAS015876: Starting deployment of "all-ejbs.jar"

      06:08:46,010 ERROR [stderr] (MSC service thread 1-5) log4j:ERROR Could not create an Appender. Reported error follows.

      06:08:46,011 ERROR [stderr] (MSC service thread 1-5) java.lang.ClassCastException: org.apache.log4j.DailyRollingFileAppender cannot be cast to org.apache.log4j.Appender

      06:08:46,012 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.parseAppender(DOMConfigurator.java:248)

      06:08:46,012 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByName(DOMConfigurator.java:176)

      06:08:46,014 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.findAppenderByReference(DOMConfigurator.java:191)

      06:08:46,015 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:523)

      06:08:46,017 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.parseCategory(DOMConfigurator.java:436)

      06:08:46,018 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.parse(DOMConfigurator.java:999)

      06:08:46,019 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:867)

      06:08:46,021 ERROR [stderr] (MSC service thread 1-5)    at org.apache.log4j.xml.DOMConfigurator.doConfigure(DOMConfigurator.java:794)

      06:08:46,022 ERROR [stderr] (MSC service thread 1-5)    at org.jboss.as.logging.LoggingConfigurationProcessor.deploy(LoggingConfigurationProcessor.java:111)

      06:08:46,024 ERROR [stderr] (MSC service thread 1-5)    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:116)

      06:08:46,027 ERROR [stderr] (MSC service thread 1-5)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

      06:08:46,028 ERROR [stderr] (MSC service thread 1-5)    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

      06:08:46,030 ERROR [stderr] (MSC service thread 1-5)    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

      06:08:46,031 ERROR [stderr] (MSC service thread 1-5)    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

      06:08:46,033 ERROR [stderr] (MSC service thread 1-5)    at java.lang.Thread.run(Thread.java:662)

       

      My custom log4j.xml is attached. The log4j.xml is packed within a jar that is deployed inside the lib folder of an EAR.

       

      In the jboss-deployment-structure.xml I'm specifying such exclusions :

       

      <?xml version="1.0" encoding="UTF-8"?>

      <jboss-deployment-structure>

       

      <deployment>

         

                <exclusions>

                          <module name="org.apache.log4j" />

                </exclusions>

       

      </deployment>

       

       

      <sub-deployment name="second.war">

                <exclusions>

                          <module name="org.apache.log4j" />

                </exclusions>

      </sub-deployment>

       

       

      <sub-deployment name="first.war">

                <exclusions>

                          <module name="org.apache.log4j" />

                </exclusions>

      </sub-deployment>

       

       

      <sub-deployment name="all-ejbs.jar">

                <exclusions>

                          <module name="org.apache.log4j" />

                </exclusions>

      </sub-deployment>

       

       

      </jboss-deployment-structure>

       

       

       

       

      Any ideas are welcome .

       

      Thank you