Results 1 to 4 of 4

Thread: Log4J classloader problem

  1. #1

    Arrow Log4J classloader problem

    Hello

    We are integrating Spring Batch into web-application (Tomcat).
    All Spring Batch - related beans are defined in separate context definition xml file.
    There is nothing specific to log4j in this file, also nothing specific to Spring Batch classes in log4j configuration.
    However when we add import of this file to the main applicationContext.xml and deploy, we are getting errors (upon deployment):

    Code:
    log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
    log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
    log4j:ERROR [org.apache.catalina.loader.StandardClassLoader@172e449] whereas object of type
    log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [WebappClassLoader
      delegate: false
      repositories:
        /WEB-INF/classes/
    ----------> Parent Classloader:
    org.apache.catalina.loader.StandardClassLoader@172e449
    ].
    log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
    Does Spring batch use any specific classloader indeed ? How to resolve this conflict ?

    Thank you.

  2. #2

    Default

    Solved. Thanks to everyone looked into this

  3. #3
    Join Date
    Jan 2010
    Posts
    1

    Default

    Hy !
    I have the same problem. I'm using weblogic instead of tomcat. Could you tel me how do you solve it.

    My error is :
    log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
    log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
    log4j:ERROR [weblogic.utils.classloaders.GenericClassLoader@6db dc9 finder: weblogic.utils.classloaders.CodeGenClassFinder@cc7 439 annotation: ] whereas object of type
    log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [sun.misc.Launcher$AppClassLoader@169e11].
    log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].

    thanks

  4. #4

    Default

    Quote Originally Posted by nvg View Post
    Hy !
    I have the same problem. I'm using weblogic instead of tomcat. Could you tel me how do you solve it.
    In my case log4j.jar was deployed with web-app , and another log4j.jar was found in tomcat \lib (which actually was not part of tomcat distribution but added by someone else).
    It was not the problem until we integrated Spring Batch though. Now we left only jar in web-app, removed the second from tomcat lib, and error dissapeared.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •