Log4J Classloading Errors

Solution Unverified - Updated -

Issue

  • I am including log4j.jar in my application, and I'm trying to use a different Log4J appender than JBoss uses:

    <appender name="FILE" class="org.apache.log4j.RollingFileAppender">
    
  • I do not include a Log4J configuration file in my application, but I want to use jboss-log4j.xml.

  • When I initialize my application, I receive the following errors:

    2011-09-09 11:05:57,524 ERROR [STDERR] (main) log4j:ERROR A "org.jboss.logging.appender.FileAppender" object is not assignable to a "org.apache.log4j.Appender" variable.
    2011-09-09 11:05:57,524 ERROR [STDERR] (main) log4j:ERROR The class "org.apache.log4j.Appender" was loaded by 
    2011-09-09 11:05:57,524 ERROR [STDERR] (main) log4j:ERROR [BaseClassLoader@3358c3ef{vfszip:/apps/jboss-eap-5.1.0/server/default/deploy/myapp.ear/mywebapp.war/}] whereas object of type 
    2011-09-09 11:05:57,524 ERROR [STDERR] (main) log4j:ERROR "org.jboss.logging.appender.FileAppender" was loaded by [org.jboss.bootstrap.NoAnnotationURLClassLoader@354124d6].
    2011-09-09 11:05:57,524 ERROR [STDERR] (main) log4j:ERROR Could not instantiate appender named "FILE".
    

Environment

Red Hat JBoss Enterprise Application Platform (EAP)

  • 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content