4 Replies Latest reply on Jun 27, 2006 2:55 PM by Roy Russo

    FYI: log4j in portlet WAR

    Sherman Wood Apprentice

      Don't include a log4j.jar in your portlet WAR. The error message you will see is:

      2005-05-24 13:55:54,919 INFO [STDOUT] log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
      2005-05-24 13:55:54,919 INFO [STDOUT] log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
      2005-05-24 13:55:54,919 INFO [STDOUT] log4j:ERROR [WebappClassLoader
       delegate: false
       repositories:
       /WEB-INF/classes/
      ----------> Parent Classloader:
      java.net.FactoryURLClassLoader@39826
      ] whereas object of type
      2005-05-24 13:55:54,919 INFO [STDOUT] log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [org.jboss.mx.loading.UnifiedClassLoader3@186df0f{ url=file:/C:/jboss-4.0.2/server/default/tmp/deploy/tmp55693jboss-service.xml ,addedOrder=2}].
      2005-05-24 13:55:54,919 INFO [STDOUT] log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
      


      I know using a JAR that is in base JBoss or in a surrounding application is a general no-no, and maybe this is a general JBoss 4.0.X exception, but I had not seen it before.

      Removing the log4j.jar from your WAR stops the exception and the JBoss logger works.


      Sherman