2 Replies Latest reply on Jun 21, 2007 2:29 AM by Advait

    log4j classcastexception with alfresco WAR

    Advait Newbie

      Hi,

      I have alfresco war deployed. When I start server it gives following exception:
      =========================================
      16:03:29,799 ERROR [STDERR] log4j:ERROR Could not create level [TRACE]. Reported error follows.
      16:03:29,799 ERROR [STDERR] java.lang.ClassCastException: org.jboss.logging.XLevel
      16:03:29,799 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseLevel(DOMConfigurator.java:512)
      16:03:29,799 ERROR [STDERR] at org.apache.log4j.xml.DOMConfigurator.parseChildrenOfLoggerElement(DOMConfigurator.java:428)
      ....
      16:03:29,846 ERROR [STDERR] log4j:ERROR A "org.jboss.logging.util.OnlyOnceErrorHandler" object is not assignable to a "o
      rg.apache.log4j.spi.ErrorHandler" variable.
      16:03:29,846 ERROR [STDERR] log4j:ERROR The class "org.apache.log4j.spi.ErrorHandler" was loaded by
      16:03:29,846 ERROR [STDERR] log4j:ERROR [WebappClassLoader
      delegate: false
      repositories:
      /WEB-INF/classes/
      ----------> Parent Classloader:
      java.net.FactoryURLClassLoader@19f768f
      ] whereas object of type
      16:03:29,846 ERROR [STDERR] log4j:ERROR "org.jboss.logging.util.OnlyOnceErrorHandler" was loaded by [org.jboss.system.se
      rver.NoAnnotationURLClassLoader@1de3f2d].
      16:03:29,924 ERROR [STDERR] log4j:ERROR Could not create an Appender. Reported error follows.
      16:03:29,924 ERROR [STDERR] java.lang.ClassCastException: org.jboss.logging.appender.DailyRollingFileAppender
      ....
      ================================================

      I dont have either log4j.jar or commons-logging.jar in alfresco/WEB-INF/lib.
      I also tried adding this to WEB-INF/jboss-web.xml:

      <?xml version="1.0"?>
      <jboss-web>
      <class-loading java2ClassLoadingCompliance="true">
      <loader-repository>
      com.example:loader=alfresco.war
      <loader-repository-config>java2ParentDelegation=true</loader-repository-config>
      </loader-repository>
      </class-loading>
      </jboss-web>

      as well as this:
      <?xml version="1.0"?>
      <jboss-web>
      <class-loading java2ClassLoadingCompliance="false">
      <loader-repository>
      com.example:loader=alfresco.war
      <loader-repository-config>java2ParentDelegation=true</loader-repository-config>
      </loader-repository>
      </class-loading>
      </jboss-web>

      But to no avail, same exceptions still persist.

      Thanks & Regards,
      Advait Trivedi