Results 1 to 2 of 2

Thread: Sort of solved same problem too

  1. #1
    Join Date
    Oct 2012
    Posts
    1

    Default Sort of solved same problem too

    Quote Originally Posted by ccobb View Post
    OK, I manually copied log4j.1.2.9.jar into WEB-INF/lib. Things are working now.

    Which means there is a problem when rebuilding a project that maven dependencies that should be in WEB-INF/lib are not getting copied there when they are missing.
    My solution was also manually copying log4j.1.2.5.jar - but into Tomcat lib directory.

    (my environment:
    - TomEE+ 1.0.0;
    - Eclipse;
    - running app from within Eclipse, with TomEE configured as target server
    ).

    The reason:
    After I turned on detailed logging of class loading (BTW - big thanks for the tip!) - I saw that the class loader that tried to load Log4J jars (as part of initializing Faces) was the Tomcat server one. I had log4j.1.2.5.jar in WEB-INF/lib dir already - but that classloader wasn't looking there, it looked into server libs. So placing log4j1.2.5.jar there solved it.

    The million dollar question:
    - Tomcat has, as part of its distribution, commons-logging.1.1.1.jar;
    - that jar has class org.apache.commons.logging.impl.Log4JLogger, which (as we saw) has *dependency* on org.apache.log4j.Category;
    - but Tomcat distribution has no jars with the Category class;
    - so when Tomcat classloader attempts to load Log4JLogger - it is bound to fail (and it does).

    Am I missing something?
    Last edited by tomilchik; Oct 25th, 2012 at 09:24 AM. Reason: added server info

  2. #2
    Join Date
    Sep 2008
    Location
    Hamburg, Germany
    Posts
    1,640

    Default

    Hey!

    I moved this thread over to the web forum, since it is more web and Tomcat related than tooling related.

    HTH,
    Martin
    Martin Lippert
    SpringSource, a division of VMware
    SpringSource Tools Team
    http://www.springsource.com
    http://twitter.com/martinlippert

Posting Permissions

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