Announcement Announcement Module
No announcement yet.
Sort of solved same problem too Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Sort of solved same problem too

    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, 09:24 AM. Reason: added server info

  • #2

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