Announcement Announcement Module
Collapse
No announcement yet.
Log4J classloader problem Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Solved. Thanks to everyone looked into this

    Comment


    • #3
      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

      Comment


      • #4
        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.

        Comment

        Working...
        X